Delen via


Get-SCSMUserRole

Retrieves user roles that are defined in Service Manager.

Syntax

Get-SCSMUserRole
   [[-DisplayName] <String[]>]
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCSMUserRole
   [-Id] <Guid[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCSMUserRole
   [-Name] <String[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The Get-SCSMUserRole cmdlet retrieves user role profiles that are defined in Service Manager. You can then use this list to add users to one of the user role profiles. Optionally, you can provide a regular expression to search for a specific user role profile.

Examples

Example 1: Get the user roles for the local computer

PS C:\>Get-SCSMUserRole
Name                          Description                   LastModified                  LastModifiedBy
----                          -----------                   ------------                  --------------
ChangeManagers                The Service Manager Change... 6/14/2010 5:14:16 AM
IncidentResolvers             The Service Manager Incide... 6/14/2010 5:14:16 AM
ActivityImplementers          The Service Manager Activi... 6/14/2010 5:14:15 AM
Workflows                     The Service Manager Workfl... 6/14/2010 5:14:16 AM
Administrators                The Service Manager Admini... 6/14/2010 5:14:16 AM
ProblemAnalysts               The Service Manager Proble... 6/14/2010 5:14:16 AM
AdvancedOperators             The Service Manager Advanc... 6/14/2010 5:14:16 AM
Authors                       The Service Manager Author... 6/14/2010 5:14:16 AM
ChangeInitiators              The Service Manager Change... 6/14/2010 5:14:16 AM
ReadOnlyOperators             The Service Manager Read-O... 6/14/2010 5:14:16 AM
EndUsers                      The Service Manager End Us... 6/14/2010 5:14:16 AM

This command retrieves the list of user roles from the local computer.

Example 2: Get the Administrators role

PS C:\>Get-SCSMUserRole -Name "Administrators"
Name                          Description                   LastModified                  LastModifiedBy
----                          -----------                   ------------                  --------------
Administrators                The Service Manager Admini... 6/14/2010 5:14:16 AM

This command retrieves the Administrators user role.

Example 3: Display the classes of a role

PS C:\>$Role = Get-SCSMUserRole -DisplayName "CustomRole"
PS C:\> $Role
DisplayName                   Description                    LastModified                  LastModifiedBy
-----------                   -----------                    ------------                  --------------
CustomRole                    Custom Description             8/6/2010 12:23:46 AM          WOODGROVE\Administrator PS C:\>$Role.Classes
Abstract Name                                                                DisplayName
-------- ----                                                                -----------
True     Microsoft.SystemCenter.ServiceDesigner.Messaging.Storage            Storage
True     Microsoft.SystemCenter.ServiceDesigner.ServiceComponentGroup        Distributed Application Component
False    Microsoft.SystemCenter.StorageDevicesGroup                          Storage Devices Group
True     Microsoft.SystemCenter.ServiceDesigner.WebApplication               Line of Business Web Application
True     Microsoft.SystemCenter.ConfigItemGroup                              All Groups
False    System.WorkItem.Incident                                            Incident
True     Microsoft.SystemCenter.ServiceDesigner.Messaging                    Messaging
True     Microsoft.SystemCenter.InstanceGroup                                All Instance Groups
True     Microsoft.SystemCenter.ServiceDesigner.WebApplication.WebSiteGroup  Web Application Web Sites
True     Microsoft.SystemCenter.ServiceDesigner.WebApplication.DatabaseGroup Web Application Databases
True     Microsoft.SystemCenter.ServiceDesigner.GenericService               Blank
True     Microsoft.SystemCenter.ServiceDesigner.Service                      User Created Distributed Application
False    Microsoft.SystemCenter.BusinessService                              Business Service

The first command gets the user role named CustomRole, and then stores it in the $Role variable.

The second command displays the contents of $Role.

The third command displays the classes of $Role.

Parameters

-ComputerName

Specifies the name of the computer on which the System Center Data Access service runs. The user account that is specified in the Credential parameter must have access rights to the specified computer.

Type:System.String[]
Position:Named
Default value:Localhost
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies the credentials that this cmdlet uses to connect to the server on which the System Center Data Access service runs. The specified user account must have access rights to that server.

Type:System.Management.Automation.PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

Specifies the display name of the user role to retrieve. You can specify a regular expression.

Type:System.String[]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Id

Specifies the ID of the user role to retrieve.

Type:System.Guid[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of the user role to retrieve. You can specify a regular expression.

Type:System.String[]
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SCSession

Specifies an object that represents a session to a Service Manager management server.

Type:Microsoft.SystemCenter.Core.Connection.Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

You can pipe a name to the DisplayName parameter.

System.Guid

You can pipe a GUID to the Id parameter.

Outputs

Microsoft.EnterpriseManagement.ServiceManager.Sdk.UserRoles.Role

The UserRole object provides the information about the Service Manager User Roles. This object can be used in conjunction with the Update-SCSMUserRole cmdlet to add a user to a user role.