Install-SCOMAgent

Install-SCOMAgent

Deploys Operations Manager agents.

Syntax

Parameter Set: Empty
Install-SCOMAgent -DNSHostName <String[]> -PrimaryManagementServer <ManagementServer> [-ActionAccount <PSCredential> ] [-AgentActionAccount <PSCredential> ] [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Install-SCOMAgent cmdlet deploys one or more System Center 2012 – Operations Manager agents by using client push installation.

Parameters

-ActionAccount<PSCredential>

Specifies a PSCredential object. This parameter specifies the credentials that Operations Manager uses to run the deployment task. If you do not specify this parameter or you specify a null value, Operations Manager uses the default action account of the management server for the agent.

This parameter does not specify the action account that the agent uses after you install it on the computer. By default, the action account that the agent uses is set to Local System. You can use the AgentActionAccount parameter to change the action account that the agent uses.

To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AgentActionAccount<PSCredential>

Specifies a PSCredential object. This parameter specifies the action account that the agent uses after it is installed on the computer. By default, the action account that the agent uses is set to Local System. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential. You can use the Get-SCOMRunAsProfile cmdlet to get a Run As accounts that you can use for the action account.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DNSHostName<String[]>

Specifies the name of a Domain Name System (DNS) host.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-PassThru

Indicates that the cmdlet creates or modifies an object that a command can use in the pipeline. By default, this cmdlet does not generate any output.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PrimaryManagementServer<ManagementServer>

Specifies a ManagementServer object. This parameter specifies the primary management server for the agent. To obtain a ManagementServer object, use the Get-SCOMManagementServer cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Install an agent on a server

This example installs an agent on a server and sets the primary management server for the agent.

The first command gets the management server object named MgmtServer01.Contoso.com and stores the object in the $PrimaryMgmtServer variable.

The second command installs an agent on Server01.Contoso.com, and sets its primary management server to the management server stored in $PrimaryMgmtServer.

PS C:\> $PrimaryMgmtServer = Get-SCOMManagementServer -ComputerName "MgmtServer01.Contoso.com"
PS C:\> Install-SCOMAgent -DNSHostName "server01.contoso.com" -PrimaryManagementServer $PrimaryMgmtServer

Example 2: Install an agent on a server by using the action account credentials

This example prompts the user to enter credentials and then uses the credentials to install an agent.

The first command prompts the user for credentials and store credentials in the $InstallAccount variable.

The second command gets the management server object named MgmtServer01.Contoso.com and stores the object in the $PrimaryMgmtServer variable.

The third command installs an agent on Server01.Contoso.com by using the credentials stored in $InstallAccount, and sets the primary management server for the agent to the management server stored in $PrimaryMgmtServer.

PS C:\> $InstallAccount = Get-Credential
PS C:\> $PrimaryMgmtServer = Get-SCOMManagementServer -ComputerName "MgmtServer01.Contoso.com"
PS C:\> Install-SCOMAgent -DNSHostName "Server01.Contoso.com" -PrimaryManagementServer $PrimaryMgmtServer -ActionAccount $InstallAccount

Example 3: Install an agent on servers and set the agent action account

This example installs agents on three computers and sets the agent action account for the agents.

The first command stores the name of three computers in the $Agents variable.

The second command prompts the user for credentials and stores the credentials in the $InstallAccount variable.

The third command prompts the user for a password for a user account named ActionAccount in the Contoso domain, and stores the credentials in the $AgentActionAccount variable.

The fourth command gets the management server object named MgmtServer01.Contoso.com and stores the object in the $PrimaryMgmtServer variable.

The fifth command installs an agent on the three computers stored in the $Agents variable by using the credentials stored in $InstallAccount. The command sets the primary management server for the agent to the management server stored in $PrimaryMgmtServer, and sets the agent action account to the ActionAccount user stored in $AgentActionAccount.

PS C:\> $Agents = "DC1.contoso.com","DC2.contoso.com","DC3.contoso.com"
PS C:\> $InstallAccount = Get-Credential
PS C:\> $AgentActionAccount = Get-Credential Contoso\ActionAccount
PS C:\> $PrimaryMgmtServer = Get-SCOMManagementserver -ComputerName MgmtServer01.contoso.com
PS C:\> $Install-SCOMAgent -DNSHostName $Agents -PrimaryManagementServer $PrimaryMgmtServer -ActionAccount $InstallAccount -AgentActionAccount $AgentActionAccount -Confirm

Get-SCOMRunAsAccount

Get-SCOMAgent

Get-SCOMManagementServer

Uninstall-SCOMAgent

Repair-SCOMAgent