Open Firewall Ports with Powershell


  
  
 
netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80

netsh advfirewall firewall add rule name="Open Port 443" dir=in action=allow protocol=TCP localport=443


netsh advfirewall firewall add rule name="Open Port 1433" dir=in action=allow protocol=TCP localport=1433
netsh advfirewall firewall add rule name="Open Port 1434" dir=in action=allow protocol=TCP localport=1434



##  or Open ports for Domain, Private  with PowerShell in ONE command:

New-NetFirewallRule -DisplayName 'HTTP Inbound' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('80', '443')

 
 

 

https://blogs.msdn.microsoft.com/timomta/2016/11/04/how-do-i-open-ports-with-powershell/

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s