Come and Check our BETA Alpha version of Powershellcenter.net
Send me your comment to Powershell@powershellcenter.com

Synopsis

Upgrades the management agent on the specified UNIX/Linux computers to the latest version available.

Syntax

Update-SCXAgent -Agent <Computer[]> [-ComputerName <string>] [-Credential <PSCredential>] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Update-SCXAgent cmdlet updates the agent on the specified computers to the latest version available. If the latest available version of the management agent is already installed a target computer, no action will be taken. The required Agent parameter specifies the target managed UNIX/Linux computers to uninstall and requires a UNIX/Linux computer object. For information about retrieving managed UNIX/Linux computers, type Get-Help Get-SCXAgent. This cmdlet accepts SshCredential and WSMANCredential input parameters. The supplied SSHCredential is used for privileged agent update actions while the supplied WSMAN credential is used for low-privileged agent communication. If the SshCredential parameter is not provided, the cmdlet will attempt to use the defined agent maintenance Run As account associated with the target computer. If the WSManCredential parameter is not provided, the cmdlet will attempt to use the defined action account Run As account associated with the target computer. The output of this cmdlet is an array of managed UNIX or Linux computer objects representing the target systems that were successfully updated.

Parameters

-Agent [<Computer[]>]

Specifies one or more managed UNIX/Linux computer objects. This parameter is accepted from the pipeline.

For information about how to get a managed UNIX/Linux computer object, type Get-Help Get-SCXAgent.

Required?   true
Position?   named
Default value?  
Accept pipeline input?   true (ByValue)
Accept wildcard characters?   false

-ComputerName [<string>]

Specifies a computer to establish a connection with. The computer must be running the Operations Manager Data Access service.

Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name. To specify the local computer, type the computer name, "localhost", or a dot (.).

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-Credential [<PSCredential>]

Specifies a user account under which the management group connection will run. The default is the current user.

Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com", or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password. For more information, type Get-Help Get-Credential

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-SshCredential [<CredentialSet>]

Specifies a privileged SSH credential used to perform the agent update actions. If this parameter is not specified, the cmdlet will attempt to use the defined agent maintenance Run As account for the agent.

For information about how to get an SSH credential object, type Get-Help Get-SCXSSHCredential.

Required?  
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-WSMANCredential [<PSCredential>]

Specifies a credential used for low-privileged agent communication through WSMan. This cmdlet uses this credential to verify agent availability.

Type a user name, such as "User01" or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password. For more information, type Get-Help Get-Credential.

Required?  
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-Confirm [<SwitchParameter>]

Prompts you for confirmation before executing the command.

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-WhatIf [<SwitchParameter>]

Describes what would happen if you executed the command without actually executing the command.

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

Input Type

Return Type

Microsoft.Unix.Computer[]

The output of this cmdlet is a collection of upgrade result, each representing the upgrade status for a computer. Each result must contain the following information:

hostname, os, old Agent version, new Agent version, upgrade status, description

*Description includes the details of why upgrade failed.

Notes

This command takes in a collection of host names in enumerated fashion. It collects all host names and process the entire collection in parallel at the end of the pipeline.

Examples

EXAMPLE 1

PS> $MyAgent = Get-SCXAgent -Name nx1.contoso.com $WSCredential = Get-Credential userBob $SSHCredential=Get-SCXSSHCredential -UserName userBob -SSHKey c:\keys\key.ppk -ElevationType sudo Update-SCXAgent -SSHCredential $SSHCredential -WSManCredential $WSCredential -Agent $MyAgent

Description

-----------

#Updates management agent using a specified SSH credential and WSMan credential.

EXAMPLE 2

PS> Get-SCXAgent -Name nx1.contoso.com | Update-SCXAgent

Description

-----------

#Updates management agent using the defined Run As accounts.