Book Image

Learning PowerCLI for VMware VSphere

By : Robert van den Nieuwendijk
Book Image

Learning PowerCLI for VMware VSphere

By: Robert van den Nieuwendijk

Overview of this book

Table of Contents (17 chapters)
Learning PowerCLI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Retrieving clusters


To retrieve one or more of the clusters available on your vCenter Server system, you can use the Get-Cluster cmdlet. The syntax of the Get-Cluster cmdlet is:

Get-Cluster [-VM <VirtualMachine[]>] [-VMHost <VMHost[]>] [-Location <VIContainer[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>]
Get-Cluster -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]

The -Location parameter enables you to filter for clusters in a specific location such as a datacenter or folder. The -Name, -Id, -VM, and -VMHost parameters specify filters that you can use to retrieve clusters with a specific name or ID, or clusters containing the specified virtual machines or hosts.

In the first example, you will retrieve the cluster named Cluster02 that you created in the preceding section of this chapter.

PowerCLI C:\> Get-Cluster -Name Cluster02

Name              HAEnabled  HAFailover DrsEnabled DrsAutomationLevel...