Creating Dynamic Groups

Creates a Dynamic Group in the current or in the specified context.


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

Create the Dynamic Computer Group "DELL-Laptops" in the context "solys.local\Chicago\ITService\Workstations":

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

New-EmdbGroup "DELL-Laptops" -TargetCategory Computer -Dynamic -Filter "BasicInventory.Vendor=Dell*"

Hint: In the context of the emdb drive, the cmdlet New-Item provides the additional parameter -DelayCreation. Using this parameter creates the object on the client side only and doesn't propagate the changes to the DSMDB instantly. Now you can manipulate properties of this object and finally the changes can be propagated to the DSMDB by calling the method Create().

Create the Dynamic Computer Group "Lenovo-Workstations" in the context "Managed Users & Computers\solys.local\Chicago\ITService\Workstations" using the cmdlet New-Item:

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

$MyNewGroup = New-Item "Lenovo-Workstations" -ItemType "DynamicGroup" -DelayCreation

$MyNewGroup.TargetCategory = "Computer"

$MyNewGroup.Filter = "(BasicInventory.Vendor=Lenovo*)"