Hello Everyone,
I have a task to remove tags of VMs that could reside in any of two vCenter servers and before I remove I have to get the list of current tags they have. Something that could collect the list of VMs from CSV and export with TAG info and I can run another script to remove Tags or may be both in one.
Thank you very much.
Just to make sure I get the question, you are looking for the Tags assigned to a specific set of VMs.
And these VMs are specified in a list (a CSV file ?), and can be sitting in 2 different vCenters.
Can a VM with the same name appear in both vCenters?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD, You are right, Thats exactly what I am looking for. And for the second question, the VM names are Unique and would never be the same.
Thank you.
If your CSV file looks like this
Name
vm1
vm2
then you could do
Select @{N='VM';E={$_.Entity.Name}},
@{N='Category';E={$_.Tag.Category}},
@{N='Tag';E={$_.Tag.Name}} |
Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference