Retrieving Roles

Retrieves Role-objects.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


All Roles defined can be retrieved using the cmdlet Get-EmdbRole.


Get-EmdbRole


As with the cmdlet Get-EmdbPermission, the returned Role-objects can be filtered. the following example just retrieves the Role 'Product Manager:


Get-EmdbRole -Path "Product Manager"


or alternatively (and more easily) 


Get-EmdbRole "Product Manager"


Retrieve the Role "Read (System Role)" through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbRole -ItemID 6


Tip: the alias ID can be used instead of ItemID.


Note: Note that Role-objects are not part of the context rootDSE and therefore they can be referenced without a full qualified path resp. an absolute path.


Starting with PSX 3.1 there was a new option implemented when retrieving Role objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is contained in the result. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.