Get-SCUserRole
Gets a VMM user role.
Syntax
Get-SCUserRole
[-VMMServer <ServerConnection>]
[[-Name] <String>]
[-UserRoleProfile <Profile>]
[-ID <Guid>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Description
The Get-SCUserRole cmdlet gets one or more 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
.
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
.
Examples
Example 1: Get all user roles
PS C:\> Get-SCUserRole -VMMServer "VMMServer01.Contoso.com"
This command gets all VMM user roles on the server named VMMServer01.Contoso.com. The command displays information about each user role.
Example 2: Get a user role by name
PS C:\> Get-SCUserRole -Name "Administrator"
This command gets the user role object named Administrator. The command displays information about that user role.
Example 3: Get a user role by profile
PS C:\> Get-SCUserRole -VMMServer "VMMServer01.Contoso.com" -UserRoleProfile "SelfServiceUser"
This command gets the user roles the server named VMMServer01 that have a user role profile of SelfServiceUser. The command displays information about these user roles.
Example 4: Display properties and other information about user role objects
PS C:\> $UserRoles = Get-SCUserRole -VMMServer "VMMServer01.Contoso.com"
PS C:\> $UserRoles | Select-Object -Property Name, UserRoleProfile, ParentUserRole, Cloud
PS C:\> $UserRoles | Get-Member
The first command gets all user role objects on the server named VMMServer01, and then stores those objects in the $UserRoles variable.
The second command passes each user role object in $UserRoles to the Select-Object cmdlet, which then displays the name, user role profile, parent user role, and cloud for each user role
The final 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.
Parameters
-ID
Specifies the unique ID for the user role that this cmdlet gets.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of the VMM user role that this cmdlet gets.
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 |
-UserRoleProfile
Specifies the type of profile that is the basis for the user roles that this cmdlet gets. The acceptable values for this parameter are:
- DelegatedAdmin
- ReadOnlyAdmin
- SelfServiceUser
Type: | Profile |
Accepted values: | Administrator, DelegatedAdmin, TenantAdmin, SelfServiceUser, ReadOnlyAdmin |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
Specifies the VMM server on which this cmdlet gets user roles.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
UserRole
This cmdlet returns a UserRole object.