Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Last active May 31, 2017 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PixelRobots/67b89212c609c70d7f31cedff39f42f7 to your computer and use it in GitHub Desktop.
Save PixelRobots/67b89212c609c70d7f31cedff39f42f7 to your computer and use it in GitHub Desktop.
# Create new VM Group
New-VMGroup -Name "BackEnd" -GroupType VMCollectionType -Verbose
# Add VMs to VM Collection Group
Add-VMGroupMember -Name "BackEnd" -VM (Get-VM "SQL01"),(Get-VM "SQL02")
# Verify Group Members
(Get-VMGroup -Name "BackEnd").VMMembers
# Find group VM is member of
Get-VM | FT Name, Groups -autosize
# Create a Management Group
New-VMGroup -Name "CRM_APP" -GroupType ManagementCollectionType
# Nest Groups to Management Group
Add-VMGroupMember -VMgroup (Get-VMGroup "CRM_APP") -VMGroupMember (Get-VMGroup "FrontEnd"), (Get-VMGroup "BackEnd")
# Verify Group nesting
(Get-VMGroup -Name "CRM_APP").VMGroupMembers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment