Continuing on from my previous post about vRops addProperties, I will now give you an example of how to create Custom Group‘s and populate them automatically with objects…

Like the previous script’s I have provided, the one below is intended to help not give you a full solution… the originals I have created contain logic specific to my needs. (lookup existing custom groups, etc…)

So to start off in the vRops GUI, I create a new group type called Criticality, the purpose of which will be used to structure and contain the custom groups which the script below will generate from unique values in the csv file.

creategroup_0

creategroup_1

creategroup_2

Metadata.csv sample

So… to the script!

Update the script with your own vRops server IP or FQDN.

Like the previous scripts… so you don’t keep being prompted for credentials, save the service account user and password with the powershell Get-Credential command.

update the XML to reflect the file generated above…

Update to point at the metadata.csv and update the XML structure to match what you need.

update the XML for your needs…

After the script finishes running you should now see the custom group’s which were generated.

creategroup_3

The group(s) automatically update(s) the members from the properties of the objects, in this case VM’s. So as more VM’s are created and assigned with the property Criticality the group members are updated.

creategroup_4

 

good luck! if you found the post helpful… please consider supporting my hosting by checking out one of the sponsored links.

Here is the full script,