Creating Static Groups
Creating Static Groups
Creates a Static Group in the current or in the specified context.
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
Create a Static Computer Groupnamed "Admin-Laptops" in the context "solys.local\Chicago\ITService\Workstations":
New-EmdbGroup "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Workstations\Admin-Laptops" -TargetCategory Computer |
Create a Static User Groupnamed "Admins" in the current context:
Cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users" New-EmdbGroup "Admins" -TargetCategory User |
Create a Static Computer Groupnamed "Admin-Workstations" in the context "Managed Users & Computers\solys.local\Chicago\ITService\Workstations" using the cmdlet New-Item:
New-Item -Path "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Workstations" -Name "Admin-Workstations" -ItemType "Group" |
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(). |
Example:
Cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users" $MyNewGroup = New-Item "User Help Desk" -ItemType "Group" -DelayCreation $MyNewGroup.TargetCategory = "User" $MyNewGroup.Create() |