You can retrieve all objects that have a specific tag assigned to them.
Prerequisites
Verify that you are connected to a vCenter Server system.
Procedure
- ♦ Get all virtual machines tagged with the salesDptTag tag.
Get-VM -Tag 'salesDptTag'
Note: You can only specify a tag filter parameter for theVM
,VMHost
,Datastore
, andVirtualPortGroup
object types.