Update-SCOMRunAsAccount

Update-SCOMRunAsAccount

Updates the credentials of an Operations Manager Run As account.

Syntax

Parameter Set: ActionAccount
Update-SCOMRunAsAccount [-ActionAccount] <ActionAccountSecureData> [-RunAsCredential] <PSCredential> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: BasicAccount
Update-SCOMRunAsAccount [-BasicAccount] <BasicCredentialSecureData> [-RunAsCredential] <PSCredential> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: BinaryAccount
Update-SCOMRunAsAccount [-BinaryAccount] <GenericSecureData> [-Path] <String> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CommunityStringAccount
Update-SCOMRunAsAccount [-CommunityStringAccount] <CommunityStringSecureData> [-CommunityString] <SecureString> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: DigestAccount
Update-SCOMRunAsAccount [-DigestAccount] <SimpleCredentialSecureData> [-RunAsCredential] <PSCredential> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SimpleAccount
Update-SCOMRunAsAccount [-SimpleAccount] <SimpleCredentialSecureData> [-RunAsCredential] <PSCredential> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: WindowsAccount
Update-SCOMRunAsAccount [-WindowsAccount] <WindowsCredentialSecureData> [-RunAsCredential] <PSCredential> [-AccountType <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-PassThru] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Update-SCOMRunAsAccount cmdlet updates the credentials of an System Center 2012 – Operations Manager Run As account. A Run As account gives users the ability to specify the necessary permissions for use with rules, tasks, monitors, and discoveries targeted to specific computers on an as-needed basis.

This cmdlet does not support SCX (cross-platform) accounts or Simple Network Management Protocol version 3 (SNMPv3) accounts.

Parameters

-AccountType<String>

Specifies the type of the Run As account. The pipeline typically populates this value automatically.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-ActionAccount<ActionAccountSecureData>

Specifies an action account as a Run As account.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-BasicAccount<BasicCredentialSecureData>

Specifies a Run As account that uses Basic Authentication.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-BinaryAccount<GenericSecureData>

Specifies a Run As account that uses Binary Authentication.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-CommunityString<SecureString>

Specifies the new community string for an SNMP version 2 Run As account that uses community string authentication.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CommunityStringAccount<CommunityStringSecureData>

Specifies an SNMP version 2 Run As account that uses community string authentication.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-ComputerName<String[]>

Specifies an array of names of computers. The cmdlet establishes temporary connections with management groups for these computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).

The System Center Data Access service must be started on the computer. If you do not specify a computer, the cmdlet uses the computer for the current management group connection.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies the user account under which the management group connection runs. Specify a PSCredential object, such as one that the Get-Credential cmdlet returns, for this parameter. For more information about credential objects, type Get-Help Get-Credential.

If you specify a computer in the ComputerName parameter, use an account that has access to that computer. The default is the current user.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DigestAccount<SimpleCredentialSecureData>

Specifies a Run As account that uses standard digest web authentication.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

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

-Path<String>

Specifies the path to a file that contains new credential data for Run As accounts that use Binary Authentication.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsCredential<PSCredential>

Specifies new credentials for account types that use a username and password.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SCSession<Connection[]>

Specifies an array of Connection objects. To get Connection objects, use the Get-SCOMManagementGroupConnection cmdlet.

If this parameter is not specified, the cmdlet uses the active persistent connection to a management group. Use the SCSession parameter to specify a different persistent connection. You can create a temporary connection to a management group by using the ComputerName and Credential parameters. For more information, type Get-Help about_OpsMgr_Connections.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SimpleAccount<SimpleCredentialSecureData>

Specifies a Run As account that uses simple web authentication.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-WindowsAccount<WindowsCredentialSecureData>

Specifies a Run As account that uses Windows authentication.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

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: Update a Windows Run As account

This example updates a Windows Run As account.

The first command gets the Run As account object named Domain Admin and stores the object in the $WindowsAccount variable.

The second command passes the Run As account stored in the $WindowsAccount variable to the Update-SCOMRunAsAccount cmdlet by using the pipeline operator. That cmdlet updates the credentials for the account to the user name and password that the user provides by responding to the prompt from the Get-Credential cmdlet.

PS C:\> $WindowsAccount = Get-SCOMRunAsAccount -Name "Domain Admin"
PS C:\> $WindowsAccount | Update-SCOMRunAsAccount -RunAsCredential (Get-Credential) 

Example 2: Update an action Run As account

This example updates credentials for an action Run As account.

The first command creates a string that contains an action account name and stores the string in the $UserName variable.

The second command prompts the user to enter a string that represents the password. It then stores the user input as a secure string in the $Password variable.

The third command creates a PSCredential object by using the name stored in the $UserName variable and the password stored in $Password. It then stores the PSCredential object in the $NewCred variable.

The last command gets the action account named SCOM Action Account. It then uses the pipeline operator to pass the account to the Update-SCOMRunAsAccount cmdlet, which updates the account with the credentials stored in the $NewCred variable.

PS C:\> $UserName = "Contoso\SCOMActionAccount"
PS C:\> $Password = Read-Host -AsSecureString
PS C:\> $NewCred = new-object System.Management.Automation.PsCredential $UserName,$Password
PS C:\> Get-SCOMRunAsAccount -Name "SCOM Action Account" | Update-SCOMRunAsAccount -RunAsCredential $newCred

Example 3: Update a Community String account

This command updates credentials for a Run As account that uses community string authentication for SNMP version 2. It gets the community string account named MyCommunityStringAccount and uses the pipeline operator to pass the account to the Update-SCOMRunAsAccount cmdlet. This cmdlet updates the community string with the value that the user enters in response to prompts from the Read-Host cmdlet. For more information, type Get-Help Read-Host.

PS C:\> Get-SCOMRunAsAccount -Name "MyCommunityStringAccount" | Update-SCOMRunAsAccount -CommunityString (Read-Host -AsSecureString) 

Example 4: Update a Binary Authentication account

This example gets the binary account object named MyBinaryAccount and uses the pipeline operator to pass the object to the Update-SCOMRunAsAccount cmdlet. This cmdlet uses the Path parameter to indicate that it gets the new account data from the file named data.txt.

PS C:\> Get-SCOMRunAsAccount -Name "MyBinaryAccount" | Update-SCOMRunAsAccount -Path ".\data.txt"

Add-SCOMRunAsAccount

Get-SCOMRunAsAccount

Get-SCOMManagementGroupConnection

New-SCOMRunAsAccount