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
Solved

powershell install feature on multiple servers windows 2008 r2 servers

Posted on 2014-04-07
7
651 Views
Last Modified: 2014-04-17
Hey guys I have been blessed with the tasks of installing the SNMP on multiple servers. I am somewhat confused on how to perform this since by hand I have to go to each server and place the following command


import-module servermanager
 and then type the following to install
add-windowsfeature <name of feature to install>


I have the list of servers saved in a text file and can reference them with get-content. Is there a way to install...As a bonus it would be great if I could add an entry in the tab of the service that get installed named snmp server. The tab names are traps  and security. In traps there is a community name and in security there is an accepted name. thanks for any help.
0
Comment
Question by:techdrive
  • 3
  • 3
7 Comments
 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
ID: 39983239
Is remoting enabled on the servers you are talking about?

You can try:

$servers = get-content c:\servers.txt
foreach ($server in $servers)
{
Invoke-Command -ComputerName $server -ScriptBlock { import-module servermanager
Start-Sleep -Seconds 15
add-windowsfeature <name of feature to install>

} -credential USERNAME


}
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39983292
you can't run invoke command since 2008 R2 by default doesn't accept PS remoting. (disabled by default)

unless it has been enabled via Group Policy.

however 2012 by default is enabled.
0
 

Author Comment

by:techdrive
ID: 39983947
I  guess I can run a for loop annable ps remoting.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39984085
yes that will work
0
 

Author Comment

by:techdrive
ID: 39987166
enable remoting with multiple computers is not working out for me.
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39988627
why not?
0
 

Author Closing Comment

by:techdrive
ID: 40006327
thanks for your solution I combined this with another one and was able to get this to work.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

860 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