Using Compare-Object to audit group memberships for differences
As mentioned in the Listing the members of a DRS group recipe, you can easily compare a rule to the existing configuration as an auditing procedure. In this recipe, you will retrieve the list of existing VMs in the group, and then compare that with a list of the VMs from the desired group. You will use the group created in the Creating a DRS group for virtual machines recipe named TTYLinux VMs
.
To make the results interesting, compare against the virtual machines WinVM1
and TTYLinux1
. Only one of these should be a match, while the others should fall out as differences. Then, you can compare the existing groups against a wildcard pattern match of TTYLinux*
.
Getting ready
To begin this recipe, you will need a PowerCLI window with an active connection to a vCenter established.
How to do it…
In order to use Compare-Object
to audit group memberships for differences, perform the following steps:
- The first thing is to obtain a cluster...