Creating Users
Creating Users
Creates a User object in the current or in the specified context.
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
Create the User "Claus Thaler" in the context "solys.local\Chicago\ITService\Users":
New-EmdbUser "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users\Claus Thaler" |
Create the User "Will Heim" in the current context:
Cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users" New-EmdbUser "Will Heim" |
Create the User "Reiner Hohn" in the context "Managed Users & Computers\solys.local\Chicago\ITService\Benutzer" using the cmdlet New-Item:
New-Item -Path "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users" -Name "Reiner Hohn" -ItemType "User" |
Create the User "Kai Craft" in the current context using the cmdlet New-Item:
Cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users" New-Item "Kai Craft" -ItemType "User" |
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" $MyNewUser = New-Item "Horst Adler" -ItemType "User" -DelayCreation $MyNewUser.FullName = "Horst W. Adler" $MyNewUser.Create() |