Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Windows PowerShell print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
PowerShell script to install SCOM Agent on multiple servers


Bookmark and Share

By: Ying Li
Posted On: 5/16/2008

Here is a PowerShell script to install SCOM agent on multiple servers.

This article was Previously posted on Ying Li's Blog

In my previous blog Re-Uniting PowerShell Console I explained how you can run SCOM related PowerShell script in regular PowerShell console.

Now continue on

PS Microsoft.EnterpriseManagement.OperationsManager.Client\OperationsManagerMonitoring::NYTWOPMP01> C:\InstallSCOMAgent.ps1

Here is what’s in InstallSCOMAent.ps1 script – becareful with the path, as SCOM seems very picky about it. You have to use full path even the serverlist is in the same directory with InstallSCOMAgent.ps1

$creds = Get-Credential

#Create an array $Servers for a list of servers

$servers = get-content c:\ServerList.txt

$DiscoCnfg = New-WindowsDiscoveryConfiguration -computername:$servers -performverification: $true -actionaccount:$creds -computertype: "server"

$ms = Get-rootManagementServer

#You have to Discover the computer first

$DiscoResults = Start-Discovery -managementserver $ms -windowsdiscoveryconfiguration:$DiscoCnfg

install-agent -ManagementServer $ms -AgentManagedComputer: $DiscoResults.custommonitoringobjects

My productivity goes up significantly because of this! :)


  myITforum.com ©2010 | Legal | Privacy