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

Synopsis

Updates the credentials of an Operations Manager Run As account.

Syntax

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

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

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

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

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

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

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

Detailed Description

The Update-SCOMRunAsAccount cmdlet updates the credentials of an Operations Manager Run As account. SCX cross-platform accounts and SNMPv3 accounts are not supported.

Parameters

-AccountType [<String>]

Specifies the type of the Run As account. This value is usually automatically populated by the pipeline.

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

-ActionAccount [<ActionAccountSecureData>]

Specifies an action account Run As account.

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

-BasicAccount [<BasicCredentialSecureData>]

Specifies a basic Run As account.

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

-BinaryAccount [<GenericSecureData>]

Specifies a binary Run As account.

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

-CommunityString [<SecureString>]

Specifies the new community string for a community string account.

Required?   true
Position?   2
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-CommunityStringAccount [<CommunityStringSecureData>]

Specifies a community string Run As account.

Required?   true
Position?   1
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 System Center Data Access service. The default 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 (.).

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

-Credential [<PSCredential>]

Specifies a user account. It must have access to the server that is specified in the ComputerName parameter if specified. The default is the current user.

Enter a PSCredential object, such as one that is returned by the Get-Credential cmdlet.

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

-DigestAccount [<SimpleCredentialSecureData>]

Specifies a digest Run As account.

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

-PassThru [<SwitchParameter>]

Returns the updated Run As account object. By default, this cmdlet does not generate any output.

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

-Path [<String>]

Specifies the path to a file that contains new credential data for binary accounts.

Required?   true
Position?   2
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-RunAsCredential [<PSCredential>]

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

Required?   true
Position?   2
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-SCSession [<Connection[]>]

Specifies a connection to a management server. The default is the current management group connection.

Enter a Management group connection object, such as one returned by the Get-SCManagementGroupConnection cmdlet.

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

-SimpleAccount [<SimpleCredentialSecureData>]

Specifies a simple Run As account.

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

-WindowsAccount [<WindowsCredentialSecureData>]

Specifies a Windows Run As account.

Required?   true
Position?   1
Default value?  
Accept pipeline input?   true (ByValue)
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

Notes

Examples

EXAMPLE 1

PS> 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 $WindowsAccount to Update-SCOMRunAsAccount which updates the credentials for the account to the user name and password provided by the user when prompted by Get-Credential. PS C:\> $WindowsAccount = Get-SCOMRunAsAccount -Name "Domain Admin" PS C:\> $WindowsAccount | Update-SCOMRunAsAccount -RunAsCredential (Get-Credential)

EXAMPLE 2

PS> The first two commands create a string containing an action account and a secure string containing a password. The third command creates a PSCredential object using the name and password from the first two commands and stores the object in the $newCred variable.The last command gets the action account named SCOM Action Account and uses the pipeline operator to pass the account to Update-SCOMRunAsAccount which updates the account with the credentials stored in $newCred. 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

PS> This command gets the community string account named MyCommunityStringAccount and uses the pipeline operator to pass the account to Update-SCOMRunAsAccount which updates the community string with the value supplied by the user when prompted by Read-Host. PS C:\> Get-SCOMRunAsAccount -Name "MyCommunityStringAccount" | Update-SCOMRunAsAccount -CommunityString (Read-Host -AsSecureString)

EXAMPLE 4

PS> This example gets the binary account object named MyBinaryAccount and uses the pipeline operator to pass the object to Update-SCOMRunAsAccount which indicates that the new account data is located in the file named data.txt by using the Path parameter. PS C:\> Get-SCOMRunAsAccount -Name "MyBinaryAccount" | Update-SCOMRunAsAccount -Path '.\data.txt'