Retrieving Users

Retrieves the specified User object(s).


Examples:


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


Retrieve the User "Adam Sam" from the Organizational Unit "Chicago\ITService\Benutzer":


Get-EmdbUser "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users\Adam Sam"


Retrieve all Users from the Organizational Unit "Chicago\ITService\Benutzer":


Get-EmdbUser "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users\*"


Retrieve all Users having their names starting with the substring "e" from "Chicago" and subordinated Organizational Units:


Get-EmdbUser "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\e*" -Recurse


Retrieve the User "Adam Sam" from the current context:


cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users"

Get-EmdbUser "Adam Sam"


Retrieve the User "Albert Tross" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbUser -ItemID 4468 -Recurse


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


Retrieve the User "Adam Sam" from the current context using the cmdlet Get-Item:


cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users"

Get-Item "Adam Sam"


Retrieve all User having their names starting with the substring "e" from "Chicago" and subordinated Organizational Units using the cmdlet Get-ChildItem:


Get-ChildItem "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago" -Filter "&(Name=e*)(SchemaTag=User)" -Recurse


Starting with PSX 3.1 there was a new option implemented when retrieving User 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.