Update-SCSMRunAsAccount

Updates RunAs account credentials.

Syntax

Update-SCSMRunAsAccount
      [-PassThru]
      [-RunAsAccount] <UserAccount[]>
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-SCSMRunAsAccount cmdlet updates the credentials that are associated with a RunAs account. Use this cmdlet to change the stored credentials for a RunAs account when that account's user name or password changes. Passwords are securely stored so that impersonation can take place for workflows and other operations.

Examples

Example 1: Changes a RunAs account password

PS C:\>$Credential = Get-Credential
PS C:\>$Account = Get-SCSMRunAsAccount -UserName "Administrator"
PS C:\>$Account.Password = $Credential.Password
PS C:\>$Account | Update-SCSMRunAsAccount

These commands set the RunAs account password according to the supplied credential object.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Specifies the output object that represents the RunAs account to update. This output object can be passed to other cmdlets.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsAccount

Specifies the object that represents the RunAs account. It contains the RunAs account name and the credentials that are associated with that account.

Type:Microsoft.EnterpriseManagement.Core.SdkUtilities.Security.UserAccount[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.EnterpriseManagement.Core.SdkUtilities.Security.UserAccount

You can pipe a RunAs account object to the RunAsAccount parameter of the Update-SCSMRunAsAccount cmdlet, for example, the object that is returned by the Get-SCRunAsAccount cmdlet.

Outputs

None.

This cmdlet does not generate any output.