Retrieving Virtualization-Clusters

Retrieves the specified Virtualization-Cluster object(s).


Examples:


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


This command retrieves the Virtualization-Cluster "XenFarm01" from the Organizational Unit "XenFarms":


Get-EmdbVirtualizationCluster "emdb:\rootDSE\Managed Virtual Environments\XenFarms\XenFarm01"


While this one retrieves all Virtualization-Clusters from this OU:


Get-EmdbVirtualizationCluster "emdb:\rootDSE\Managed Virtual Environments\XenFarms\*"


The following command gets all Virtualization-Cluster objects having a name beginning with "Test" from the Virtual Environments tree and all subordinated Organizational Units:


Get-EmdbVirtualizationCluster "emdb:\rootDSE\Managed Virtual Environments\TEST*" -Recurse


The snippet below retrieves the Virtualization-Cluster "Cluster Frankfurt" from the current context:


Cd "emdb:\rootDSE\Managed Virtual Environments\Xen Clusters"

Get-EmdbVirtualizationCluster "Cluster Frankfurt"


Retrieve the Virtualization-Cluster "Hamburg" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbVirtualizationCluster -ItemID 873 -Recurse


Tip: the alias ID can be used instead of ItemID.


And this code retrieves the Virtualization-Cluster "XenCluster" from the current context using the Get-Item cmdlet:


Cd "emdb:\rootDSE\Managed Virtual Environments\Xen Clusters"

Get-Item "XenCluster"


Using the Get-ChildItem cmdlet, the following command retrieves all Virtualization-Cluster objects, having a name beginning with "Xen" from  the Virtual Environments tree and all subordinated Organizational Units:


Get-ChildItem "emdb:\rootDSE\Managed Virtual Environments" -Filter "&(Name=Xen*)(SchemaTag=VirtualizationCluster)" -Recurse


Starting with PSX 3.1 there was a new option implemented when retrieving Virtualization-Clusters objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is contained in the result. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.