Solved

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

Posted on 2016-07-21
2
60 Views
Last Modified: 2016-07-21
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
Comment
Question by:creative555
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 41723544
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
 

Author Closing Comment

by:creative555
ID: 41723954
thank you so much! Simple and nice :)
0

Featured Post

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question