BRONZE PARTNER:
BRONZE PARTNER:
Industry News:

| |
| |
 |
 |
 |
 |
 |
| PowerShell script to install SCOM Agent on multiple servers |
 |
|
|
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! :)
|
 |
 |
 |
|
|