Get-SCUserRole

Applies To: System Center 2012 - Virtual Machine Manager

Get-SCUserRole

Gets a VMM user role.

Syntax

Parameter Set: Default
Get-SCUserRole [[-Name] <String> ] [-UserRoleProfile <Profile> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Get-SCUserRole cmdlet gets one or more System Center Virtual Machine Manager (VMM) user roles. VMM uses role-based security to define the boundaries within which members of a given user role can operate and the set of allowed operations members of a user role can perform.

For information about creating user roles, type: "Get-Help New-SCUserRole -detailed".

For information about setting the properties of a user role, including the scope for delegated and read-only administrators and the scope and actions for self-service users, type: "Get-Help Set-SCUserRole -detailed".

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

Parameters

-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

-UserRoleProfile<Profile>

Specifies the type of profile to use as the basis for the user role. Valid values are: DelegatedAdmin, ReadOnlyAdmin, SelfServiceUser.

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.

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.

  • UserRole

Examples

1: Get all VMM user roles.

This command gets all VMM user role objects on VMMServer01 and displays information about each user role.

PS C:\> Get-SCUserRole -VMMServer "VMMServer01.Contoso.com"

2: Get a specific user role by name.

This command gets the user role object named Administrator, and then displays information about that user role to the user.

PS C:\> Get-SCUserRole -Name "Administrator"

3: Get a specific user role by UserRoleProfile.

This command gets the user role objects on VMMServer01 that have a UserRoleProfile value of "SelfServiceUser", and then displays information about these users role to the user.

PS C:\> Get-SCUserRole -VMMServer "VMMServer01.Contoso.com" -UserRoleProfile "SelfServiceUser"

4. Display properties and other information about user role objects.

The first command gets all user role objects on VMMServer01 and stores the objects in the $UserRoles variable.

The second command passes each user role object in $UserRoles to "select" (the alias for the Select-Object cmdlet) and then displays the name, user role profile, parent user role, and cloud for each user role

The last command passes each user role in $UserRoles to the Get-Member cmdlet, which displays the .NET type for each user role and the methods and properties associated with each user role type.

PS C:\> $UserRoles = Get-SCUserRole -VMMServer "VMMServer01.Contoso.com"
PS C:\> $UserRoles | select Name, UserRoleProfile, ParentUserRole, Cloud
PS C:\> $UserRoles | Get-Member

Grant-SCResource

New-SCUserRole

Remove-SCUserRole

Revoke-SCResource

Set-SCUserRole