블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
  • total
  • today
  • yesterday
2018. 10. 27. 22:44 Powershell

#방화벽 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


posted by bedbmsguru