Retrieving Domain Objects

Retrieves the specified domain object(s).


Examples:


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


Retrieve the Domain object "solys.local"  from the container "Managed Users & Computers":


Get-EmdbDomain "emdb:\rootDSE\Managed Users & Computers\solys.local"


Retrieve all Domain objects from the container "Managed Users & Computers" and its subcontainers:


Get-EmdbDomain "emdb:\rootDSE\Managed Users & Computers\*" -Recurse


Retrieve the Domain object "solys.local" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbDomain -ItemID 986 -Recurse


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


Retrieve the Domain object "solys.local" from the current directory context using the cmdlet Get-Item:


Cd "emdb:\rootDSE\Managed Users & Computers"

Get-Item "solys.local"


Retrieve all Domain objects from the container "Managed Users & Computers" and its subcontainers using the cmdlet Get-ChildItem:


Get-ChildItem "emdb:\rootDSE\Managed Users & Computers" -Filter "SchemaTag=Domain" -Recurse


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