Skip to content

Instantly share code, notes, and snippets.

@jangeador
Last active September 28, 2016 16:09
Show Gist options
  • Select an option

  • Save jangeador/228302a102809ff62a7a1cee9bcf8e3e to your computer and use it in GitHub Desktop.

Select an option

Save jangeador/228302a102809ff62a7a1cee9bcf8e3e to your computer and use it in GitHub Desktop.
Windows Firewall Commands
# Create and Enable Allow Ping Rule
# Windows server 2012
New-NetFirewallRule –DisplayName “Allow Ping” –Direction Inbound –Action Allow –Protocol icmpv4 –Enabled True
#Allow WMI and Windows PowerShell remote access on a device (Industry 8.1)
# To enable WMI and Windows PowerShell remote access on a device
# If your device is in a workgroup, you may need to disable Remote User Account #Control (UAC). Open a command prompt with administrator user rights and type the #following to disable Remote UAC:
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
# Type the following to establish a Windows Firewall exception for Remote Administration:
netsh advfirewall set service RemoteAdmin enable
# Type the following to enable WMI traffic at a command prompt by using a WMI rule:
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
# Type the following to establish a Windows Firewall exception for DCOM port 135:
netsh advfirewall firewall add rule dir=in name="DCOM" program=%systemroot%\system32\svchost.exe service=rpcss action=allow protocol=TCP localport=135
# Type the following to establish a Windows Firewall exception for the WMI service:
netsh advfirewall firewall add rule dir=in name ="WMI" program=%systemroot%\system32\svchost.exe service=winmgmt action = allow protocol=TCP localport=any
# Type the following to establish a Windows Firewall exception for the sink that receives callbacks from a remote device:
netsh advfirewall firewall add rule dir=in name ="UnsecApp" program=%systemroot%\system32\wbem\unsecapp.exe action=allow
# Type the following to establish a Windows Firewall exception for outgoing connections to a remote device that the local computer is communicating with asynchronously:
netsh advfirewall firewall add rule dir=out name ="WMI_OUT" program=%systemroot%\system32\svchost.exe service=winmgmt action=allow protocol=TCP localport=any
# Create and Enable Allow Ping Rule
# Windows server 2012
New-NetFirewallRule –DisplayName “Allow Ping” –Direction Inbound –Action Allow –Protocol icmpv4 –Enabled True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment