You can assign a tag to a group of virtual machines. For example, you can assign a custom tag to all virtual machines that belong to a specific department in your organization.

Prerequisites

Verify that you are connected to a vCenter Server system.

Procedure

  1. Get the virtual machines of a department in your organization.
    $vms = Get-VM sales-dpt*
  2. Assign the custom tag to the group of virtual machines.
    New-TagAssignment -Tag $salesDptTag -Entity $vms