Get-SCRunAsAccount

Gets a list of Run As accounts.

Description

The Get-SCRunAsAccount cmdlet gets a list of System Center Virtual Machine Manager (VMM) Run As accounts.

For more information about Get-SCRunAsAccount, type: "Get-Help Get-SCRunAsAccount -online".

Parameters

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

IsEnabled

Required? false
Accept Pipeline Input? false
Position? named
Retrieves, when set to $True, Run As accounts that are enabled. When set to $False, Run Accounts that are disabled are returned.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Examples

1: Get a Run As account by its name.
PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> $RunAsAccount
The first command gets the Run As account object named RunAsAccount01 and stores the object in the $RunAsAccount variable.

The second command displays information about the Run As account stored in $RunAsAccount to the user.
2: Get an enabled Run As account by its name.
PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01" -IsEnabled $True
PS C:\> $RunAsAccount
The first command gets the enabled Run As account object named RunAsAccount01 and stores the object in the $RunAsAccount variable.

The second command displays information about the Run As account stored in $RunAsAccount to the user.
3: Get enabled Run As accounts that contain a specified string in their name.
PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name *Account* -IsEnabled $True
PS C:\> $RunAsAccount[0]
PS C:\> $RunAsAccount[1]

The first command gets all enabled Run As account objects that contain "Account" in their names and stores the objects in the $RunAsAccount array.

The second command displays information about the first Run As account in the $RunAsAccount array to the user. The third command displays information about the second Run As account in the $RunAsAccount array to the user.

See Also