• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 79
  • Last Modified:

powershell help. I want to run the netsh command and update firewall on multiple servers at once. how would i do it?

Hi,
I would like to run the following netsh command and update firewall on multiple servers all at once. how would i do it?  this is cmd command not powershell. do you have a script to run it on multiple servers?

Thank you so much!

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
0
creative555
Asked:
creative555
1 Solution
 
becraigCommented:
gc serverlist.txt | %  { 
invoke-command -cn $_ -scriptblock {
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes 
}
}

Open in new window

0
 
creative555Author Commented:
thank you so much! Simple and nice :)
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now