我在PowerShell脚本下面使用添加规则来阻止某些IP:
Write-Host "Check if the outbound firewall rules exists , else create it."
$firewallOutgoingRule = Get-NetFirewallRule -DisplayName "BlockOutgoingMonitoring"
If ($firewallOutgoingRule -eq $null)
{
Write-Host "Outbound firewall rules does not exist so create it."
New-NetFirewallRule -DisplayName BlockOutgoingMonitoring -Direction Outbound -Action Block -RemoteAddress /* Some Ips*/
}
else
{
Write-Host "Outbound firewall rules already exist so continue."
}
Write-Host "Check if the inbound firewall rules exists , else create it."
$firewallIncomingRule = Get-NetFirewallRule -DisplayName "BlockIncomingMonitoring"
If ($firewallIncomingRule -eq $null)
{
Write-Host "Inbound firewall rules does not exist so create it."
New-NetFirewallRule -DisplayName BlockIncomingMonitoring -Direction Inbound -Action Block -RemoteAddress /* Some Ips*/
}
else
{
Write-Host "Inbound firewall rules already exist so continue."
}
我目前遇到的问题是,一旦我将此脚本作为从SetupEntryPoint
调用的设置的一部分运行,SF资源管理器将断开与应用程序的连接并转向页面无法显示。脚本执行后我无法访问此应用程序。
我可以分享更多详细信息,但任何您认为脚本或方法明显错误的内容。
答案 0 :(得分:0)
由于我的节点类型在负载均衡器上设置了探测规则,因此发生了这种情况。这是我们试图阻止的IP。我们将Probe更改为我们公开的监控端口之一并解决了问题。