Retrieving Dynamic Groups

Retrieves the specified Dynamic Group object(s).


Examples:


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


Retrieve the Dynamic Group "Adobe Acrobat 9" from the Domain "solys.local":


Get-EmdbGroup "emdb:\rootDSE\Managed Users & Computers\solys.local\Adobe Acrobat 9" -SchemaTag "DynamicGroup"


Retrieve all Dynamic Groups from the whole organization:


Get-EmdbGroup "emdb:\*" -SchemaTag "DynamicGroup" -Recurse


Retrieve all Dynamic Groups having their names starting with the substring "A" from "Chicago" and subordinated Organizational Units:


Get-EmdbGroup "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\A*" -SchemaTag "DynamicGroup" -Recurse


Retrieve the Dynamic Group "GData AntiVirus 2009" from the current context:


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

Get-EmdbGroup "GData AntiVirus 2009" -SchemaTag "DynamicGroup"


Retrieve the Dynamic Group "DELL" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbGroup -ItemID 1123 -Recurse


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


Retrieve the Dynamic Group "GData AntiVirus 2009" from the current context using the cmdlet Get-Item:


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

Get-Item "GData AntiVirus 2009"


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


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


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