Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell enable firewall rules - All File & Printer Sharing (where profile is private)

I'd like to know how to write a powershell script to enable inbound firewall on windows 7 for all File & Printer Sharing rules where profile is private.

I have already written scripts to insert additiontal rules, but don't know how to update built in rules.

like image 718
DermFrench Avatar asked Oct 15 '25 04:10

DermFrench


1 Answers

Not for Windows 7 sorry, but for anyone else that find this thread like me for looking for a way to enable file shares on a Windows Core server.

Set-NetFirewallRule -Name 'FPS-SMB-In-TCP' -Enabled True

got by looking at the results of

Get-NetFirewallRule | Where-Object { $_.Name -like '*FPS*' } | Select-Object Name,Enabled,Direction
like image 130
user5583436 Avatar answered Oct 18 '25 01:10

user5583436



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!