Retrieve Tag Assignments

You can retrieve tag assignments by using category and entity filters.

Prerequisites

Verify that you are connected to a vCenter Server system.

Procedure

  1. Retrieve all virtual machines that have a tag from the ownerTagCategory tag category assigned to them.
    Get-TagAssignment -Category $ownerTagCategory
  2. Retrieve the owner of the MyVM virtual machine.
    Get-TagAssignment -Category $ownerTagCategory -Entity 'MyVM'