#방화벽 ON|OFF -profile 없으면 전체(2012부터 가능)
Set-NetFirewallProfile -Profile Domain -Enabled True | false
#방화벽 Rule ADD
New-NetFirewallRule -DisplayName "Allow SSR_PORT" -Direction Inbound -LocalPort 135-139 -Protocol TCP -Action Allow
(2008 netsh 사용)netsh advfirewall firewall add rule name="SQL SERVER TCP 1433" dir=in action=allow protocol=TCP localport=1433
#방화벽 Rule 제거
Remove -NetFirewallRule -DisplayName "Allow SSR_PORT"
#등록된 RULE 켜고 끄기
Set-NetfirewallRule -DisplayName "Allow Inbound OpenVPN Client Requests" -Enabled True | false
$TargetComputer=New-CIMSession -Computername host1, host2
Set-NetfirewallRule -DisplayName "파일 및 프린터 공유(에코 요청 - ICMPv4-In)" -Enabled True -CimSession $TargetComputer
#관리할 remote server 지정
$TargetComputer=New-CIMSession -Computername hhiwp046, hhiwp047, hhiwp048, hhiwp049, hhiwp050, hhiwp051, hhiwp052
#Remove-NetFirewallRule -DisplayName "Allow SSR_PORT" -CimSession $TargetComputer
#New-NetFirewallRule -DisplayName "Allow SSR_PORT" -Direction Inbound -LocalPort 135-139 -Protocol TCP -Action Allow -CimSession $TargetComputer