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

Here is how you'd open the same ports for only the Domain and Private profiles (not Public) with PowerShell:

New-NetFirewallRule -DisplayName 'HTTP(S) 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/

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-10-13
  • 2022-12-23
  • 2021-11-23
  • 2021-12-09
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
  • 2021-11-15
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案