Home > OM12 Powershell, Operations Manager 2012 RC > OM12 RC – Deploying agents with Powershell

OM12 RC – Deploying agents with Powershell


In the help file for Install-SCOMAgent there are 4 examples for deploying agents. I’ll describe the first two today. The first example will work in a small lab where the possibility of having admin rights on the OM12 system and the systems your deploying to is much more likely than in a production environment. The Server name should be in FQDN format or the get-scommanagementserver cmdlet will not return a value. While the agent is being deployed the Operations Manager Shell will only run that command till the agent install is completed, which should only take a few minutes to complete.

PS C:\> $PrimaryMgmtServer = Get-SCOMManagementServer -Name "omvnextqa03.qa.net"

PS C:\> Install-SCOMAgent -Name "Mdbqa01.qa.net" -PrimaryManagementServer $PrimaryMgmtServer

AgentOperation ErrorCode Description AgentName

————– ——— ———– ———

AgentInstall 0 The Operations Manager Ser… mdbqa01.qa.net

Example two worked well too. After executing the three lines of code, the server showed up in pending actions as the agent being installed. Line one allows you to enter credentials into a logon dialog box, that will be used to deploy the agents. Line two sets the primary management server. Don’t forget to use FQDN when specifying Management Server Names or agent names your deploying to. The third line installs the agent on machine MDBQA02 using the primary management Server from line two and the Action Account specified in line one.

$InstallAccount = Get-Credential

$PrimaryMgmtServer = Get-SCOMManagementServer -Name "omvnextqa03.qa.net"

Install-SCOMAgent -Name "MDBQA02.qa.net" -PrimaryManagementServer $PrimaryMgmtServer -ActionAccount $InstallAccount

Look for more in the near future.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: