PowerShell: Allow File and Printer Sharing Through Windows Firewall

To allow file and printer sharing, you may need to open the Windows Firewall. Here’s a one line PowerShell script that allows file and printer sharing through the Windows Firewall by enabling the firewall rule group:

Enable-NetFirewallRule -Group "@FirewallAPI.dll,-28502" -Direction Inbound

To see a list of the available firewall groups, you can run the following:

Get-NetFirewallRule | Select-Object -Property Name, Group, Direction

Hope this helps!

This entry was posted in PowerShell, Windows Server 2012. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *