Get-SCRunAsAccount

Gets VMM Run As accounts.

Syntax

Get-SCRunAsAccount
   [-VMMServer <ServerConnection>]
   [-ID <Guid>]
   [[-Name] <String>]
   [-IsEnabled <Boolean>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The Get-SCRunAsAccount cmdlet gets Virtual Machine Manager (VMM) Run As accounts.

Examples

Example 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.

Example 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.

Example 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.

Parameters

-ID

Specifies the numerical identifier as a globally unique identifier, or GUID, for a specific object.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IsEnabled

Indicates whether this cmdlet retrieves Run As accounts that are enabled. If you specify $False, the cmdlet returns Run Accounts that are disabled.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of a VMM object.

Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

RunAsAccount

This cmdlet returns a RunAsAccount object.