Powershell firewall ports for SharePoint 2010 / 2013 / 2016 / 2019

These scripts will open all useful ports, you can lock it down by removing the ports you dont want open.

Run these on your SharePoint servers

New-NetFirewallRule -DisplayName 'SharePoint TCP' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('80', '443', '1433', '445', '25', '16500-16519', '22233-22236', '808', '32843', '32844', '32845', '32846', '636', '5725', '389', '88', '53', '809')

New-NetFirewallRule -DisplayName 'SharePoint UDP' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol UDP -LocalPort @('1434', '389', '88', '53', '464')





Run these on your SQL server, change 1433 if this is different from the default in sql server

New-NetFirewallRule -DisplayName 'SQL TCP' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('1433', '1434', '2383', '2382', '135', '80', '443')

New-NetFirewallRule -DisplayName 'SQL TCP' -Profile @('Domain', 'Private') -Direction Outbound -Action Allow -Protocol TCP -LocalPort @('1433', '1434', '2383', '2382', '135', '80', '443')

New-NetFirewallRule -DisplayName 'SQL UDP' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('1434')

New-NetFirewallRule -DisplayName 'SQL UDP' -Profile @('Domain', 'Private') -Direction Outbound -Action Allow -Protocol TCP -LocalPort @('1434')



- Alex Gladwell

Comments

Popular Posts