Retrieving Active Directory Groups

Retrieves the specified Active Directory Group object(s).


Examples:


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


Retrieve the External Group "Domain Users" from the Domain "solys.local":


Get-EmdbGroup "emdb:\rootDSE\Managed Users & Computers\solys.local\Domain Users" -SchemaTag "ExternalGroup"


Retrieve all External Groups from the whole organization:


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


Retrieve all External 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 "ExternalGroup" -Recurse


Retrieve the External Group "Domain-Admins" from the current context:


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

Get-EmdbGroup "Domain-Admins" -SchemaTag "ExternalGroup"


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


Get-EmdbGroup -ItemID 7623 -Recurse


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


Retrieve the External 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 External 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=ExternalGroup)" -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.