Update-SCXAgent
Update-SCXAgent
Upgrades the management agent on the specified UNIX and Linux computers to the latest version available.
Syntax
Parameter Set: Default
Update-SCXAgent [-Agent] <IPersistedUnixComputer[]> -WsManCredential <PSCredential> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SshCredential <PSCredential> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: Empty
Update-SCXAgent [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: FromAgentNames
Update-SCXAgent [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: FromManagementServer
Update-SCXAgent [-SCSession <Connection[]> ] [-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 targeted computer, no action is taken.
The required Agent parameter specifies the targeted managed UNIX and Linux computers to uninstall and requires a UNIX and Linux computer object. For information about retrieving managed UNIX and Linux computers, type Get-Help Get-SCXAgent
. This cmdlet accepts SshCredential and WsManCredential input parameters. The supplied SshCredential parameter is used for privileged agent update actions while the supplied WsManCredential is used for low-privileged agent communication. If the SshCredential parameter is not provided, the cmdlet attempts to use the defined agent maintenance Run As account associated with the targeted computer.
The output of this cmdlet is an array of managed UNIX or Linux computer objects representing the targeted systems that were successfully updated.
Parameters
-Agent<IPersistedUnixComputer[]>
Specifies one or more managed UNIX or Linux computer objects. For information about how to get a managed UNIX or Linux computer object, type Get-Help Get-SCXAgent
.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-ComputerName<String[]>
Specifies the name of a computer to establish a connection with. The computer must be running the System Center Data Access Service. The default value is the computer for the current management group connection. 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 (.).
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
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 are prompted for a password. For more information, type Get-Help Get-Credential
.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-SCSession<Connection[]>
Specifies a connection.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-SshCredential<PSCredential>
Specifies a privileged SshCredential parameter used to perform the agent update actions. If this parameter is not specified, the cmdlet attempts 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
.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
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 that is returned by the Get-Credential cmdlet. When you type a user name, you are prompted for a password. For more information, type Get-Help Get-Credential
.
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.
Microsoft.Unix.Computer[]
This cmdlet returns a collection of upgrade results, each representing the upgrade status for a computer. Each result must contain the following information:
Hostname, operating systemS, old Agent version, new Agent version, upgrade status, description
*Description includes the details of why upgrade failed.
Notes
- This cmdlet takes in a collection of host names in enumerated fashion. It collects all host names and processes the entire collection in parallel at the end of the pipeline.
Examples
-------------------------- EXAMPLE 1 --------------------------
Description
-----------
This command updates the management agent by using a specified SSHCredential and WSManCredential.
C:\PS>$MyAgent = Get-SCXAgent -Name nx1.contoso.com
$WSCredential = Get-Credential userBob
$SSHCredential=Get-SCXSSHCredential -UserName userBob -Key c:\keys\key.ppk -ElevationType sudo
Update-SCXAgent -SSHCredential $SSHCredential -WSManCredential $WSCredential -Agent $MyAgent
-------------------------- EXAMPLE 2 --------------------------
Description
-----------
This command updates the management agent by using the defined Run As account.
C:\PS>Get-SCXAgent -Name nx1.contoso.com | Update-SCXAgent