Share via


Get-SCOMRunAsAccount

Gets a Run As account for a management group.

Syntax

EmptyParameterSet (Default)

Get-SCOMRunAsAccount
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromRunAsAccountName

Get-SCOMRunAsAccount
    [-Name] <String[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromId

Get-SCOMRunAsAccount
    -Id <Guid[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

Description

The Get-SCOMRunAsAccount cmdlet gets Run As accounts for a System Center - Operations Manager management group. 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.

Examples

Example 1: Get all action accounts

PS C:\>Get-SCOMRunAsAccount

This command gets all action accounts.

Example 2: Get all data warehouse accounts

PS C:\>Get-SCOMRunAsAccount -Name "Data Warehouse*"

This command gets all accounts whose names begin with Data Warehouse.

Example 3.1: Update any account password - Automated (Clear Text)

PS C:\>$account = Get-SCOMRunAsAccount -Name SCX_Account
PS C:\>$password = "Password" | ConvertTo-SecureString -AsPlainText -Force
PS C:\>$account.Data = $password
PS C:\>$account.Update()

This command will allow you to update the password for the "SCX_Account" RunAs account using the built in method Data. This example allows you to update the password with clear text. This above method of updating the password will work with any RunAs Account.

Example 3.2: Update any account password - Prompt

PS C:\>$account = Get-SCOMRunAsAccount -Name SCX_Account
PS C:\>$password = Read-Host -AsSecureString
PS C:\>$account.Data = $password
PS C:\>$account.Update()

This command will allow you to update the password for the "SCX_Account" RunAs account using the built in method Data. This example allows you to update the password with a prompt. The above method of updating the password will work with any RunAs Account.

Parameters

-ComputerName

Specifies an array of names of computers. The cmdlet establishes temporary connections with management groups for these computers. Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name (FQDN). To specify the local computer, specify the computer name, localhost, or a dot (.).

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

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.

This account must have access to the server that is specified in the ComputerName parameter if that parameter appears.

If you do not specify this parameter, the default is the account for the current user.

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specifies an array of account IDs.

Parameter properties

Type:

Guid[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromId
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies an array of account names.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

FromRunAsAccountName
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SCSession

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

If this parameter does not appear, 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.

Parameter properties

Type:

Connection[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.