Creating Organizational Units

As in the "Computers and Users"-view described here, Virtualization-hosts are created in Organizational Units. The difference is, that the objects handled in this chapter, are created underneath the folder "Virtual Environments".


Examples:


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


Creation of the Organizational Unit "ESXServers" in the context "Virtual Environments":


New-EmdbOrganizationalUnit "emdb:\rootDSE\Managed Virtual Environments\ESXServers"


This code creates the Organizational Unit "Hyper-V" in the current context:


Cd "emdb:\rootDSE\Managed Virtual Environments"

New-EmdbOrganizationalUnit "Hyper-V"


Using the New-Item cmdlet, the Organizational Unit "XenServers" is created in the context "Virtual Environments":


New-Item -Path "emdb:\rootDSE\Managed Virtual Environments" -Name "XenServers" -ItemType "OU"


The following code snippet creates the OU "Other" in the current context using the New-Item cmdlet:


Cd "emdb:\rootDSE\Managed Virtual Environments"

New-Item "Other" -ItemType "OU"


Hint: You can create Organizational Units with the alias Mkdir, too.


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 Virtual Environments"

$MyNewOU = New-Item "Parallels" -ItemType "OU" -DelayCreation

$MyNewOU.Description = "Parallels VMs are organized in this OU"

$MyNewOU.Create()