Creating Domain Objects

Creates a domain object in the current or in the specified context.


Examples:


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


Create the domain "Munich" in the context "Managed Users & Computers\solys.local":


New-EmdbDomain "emdb:\rootDSE\Managed Users & Computers\solys.local\Munich"


Create the domain "Moscow" in the current context:


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

New-EmdbDomain "Moscow"


Create the domain "Beijing" in the context "Managed Users & Computers\solys.local" using the cmdlet New-Item:


New-Item -Path "emdb:\rootDSE\Managed Users & Computers\solys.local" -Name "Beijing" -ItemType "Domain"


Create the domain "Rome" in the current context using the cmdlet New-Item:


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

New-Item "Rome" -ItemType "Domain"


Hint: You can create new domains with the alias mkdir, too, if the current context is "rootDSE".


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"

$MyNewDomain = New-Item "Berlin" -ItemType "Domain" -DelayCreation

$MyNewDomain.Description = "The new Berlin domain"

$MyNewDomain.Create()


Hint: Domain objects are only allowed as direct child objects of rootDSE and other domain objects. They can not be created as child objects of Organizational Units or Group objects for instance.