Get-SCSMUserRole
Hämtar de användarroller som definieras i 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
Cmdleten Get-SCSMUserRole hämtar användarrollprofiler som definieras i Service Manager. Du kan sedan använda den här listan för att lägga till användare i någon av användarrollprofilerna. Du kan också ange ett reguljärt uttryck för att söka efter en specifik användarrollprofil.
Exempel
Exempel 1: Hämta användarrollerna för den lokala datorn
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
Det här kommandot hämtar listan över användarroller från den lokala datorn.
Exempel 2: Hämta rollen Administratörer
PS C:\>Get-SCSMUserRole -Name "Administrators"
Name Description LastModified LastModifiedBy
---- ----------- ------------ --------------
Administrators The Service Manager Admini... 6/14/2010 5:14:16 AM
Det här kommandot hämtar användarrollen Administratörer.
Exempel 3: Visa klasserna för en roll
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
Det första kommandot hämtar användarrollen CustomRole och lagrar den sedan i variabeln $Role.
Det andra kommandot visar innehållet i $Role.
Det tredje kommandot visar klasserna för $Role.
Parametrar
-ComputerName
Anger namnet på den dator där System Center Data Access-tjänsten körs. Det användarkonto som anges i parametern Autentiseringsuppgifter måste ha åtkomstbehörighet till den angivna datorn.
Type: | System.String[] |
Position: | Named |
Default value: | Localhost |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Credential
Anger de autentiseringsuppgifter som denna cmdlet använder för att ansluta till servern där System Center Data Access-tjänsten körs. Det angivna användarkontot måste ha åtkomstbehörighet till den servern.
Type: | System.Management.Automation.PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Anger visningsnamnet för den användarroll som ska hämtas. Du kan ange ett reguljärt uttryck.
Type: | System.String[] |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Id
Anger ID för användarrollen som ska hämtas.
Type: | System.Guid[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Anger namnet på den användarroll som ska hämtas. Du kan ange ett reguljärt uttryck.
Type: | System.String[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SCSession
Anger ett objekt som representerar en session till en Service Manager hanteringsserver.
Type: | Microsoft.SystemCenter.Core.Connection.Connection[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indata
System.String
Du kan skicka ett namn till parametern DisplayName .
System.Guid
Du kan skicka ett GUID till ID-parametern .
Utdata
Microsoft.EnterpriseManagement.ServiceManager.Sdk.UserRoles.Role
UserRole-objektet innehåller information om Service Manager användarroller. Det här objektet kan användas tillsammans med cmdleten Update-SCSMUserRole för att lägga till en användare i en användarroll.