O'Reilly logo

PowerCLI Cookbook by Philip Sellers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required