Get-SCRunAsAccount

Get-SCRunAsAccount

Gets VMM Run As accounts.

Syntax

Parameter Set: Default
Get-SCRunAsAccount [[-Name] <String> ] [-ID <Guid]> ] [-IsEnabled <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

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

Parameters

-ID<Guid]>

Specifies the numerical identifier as a globally unique identifier (GUID) for a specific object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IsEnabled<Boolean]>

Retrieves, when set to $True, Run As accounts that are enabled. When set to $False, Run Accounts that are disabled are returned.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUser<System.String>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

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.

  • RunAsAccount
  • RunAsAccount[]

Examples

Example 1: Get a Run As account by its name

The first command gets the Run As account object named RunAsAccount01, and then stores the object in the $RunAsAccount variable.

The second command displays information about the Run As account stored in $RunAsAccount.

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> $RunAsAccount

Example 2: Get an enabled Run As account by its name

The first command gets the enabled Run As account object named RunAsAccount01, and then stores the object in the $RunAsAccount variable.

The second command displays information about the Run As account stored in $RunAsAccount.

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01" -IsEnabled $True
PS C:\> $RunAsAccount

Example 3: Get enabled Run As accounts that contain a specified string in their name

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

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

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name *Account* -IsEnabled $True
PS C:\> $RunAsAccount[0]
PS C:\> $RunAsAccount[1] 

New-SCRunAsAccount

Remove-SCRunAsAccount

Disable-SCRunAsAccount

Enable-SCRunAsAccount

Set-SCRunAsAccount