Morning,
We upgraded our server from VMware 5.5 to 6.5. The script that we previously used to gather all the tag information worked until the upgrade to 6.5. Here is the script:
Get-VM | Select Name,
@{N="Contact";E={((Get-TagAssignment -Entity $_ -Category Contact | select -ExpandProperty Tag).Name )}},
@{N="Purpose";E={((Get-TagAssignment -Entity $_ -Category Purpose | select -ExpandProperty Tag).Name )}},
@{N="Patch";E={((Get-TagAssignment -Entity $_ -Category Patch | select -ExpandProperty Tag).Name )}},
@{N="Lifecycle";E={((Get-TagAssignment -Entity $_ -Category Lifecycle | select -ExpandProperty Tag).Name )}},
@{N="Application";E={((Get-TagAssignment -Entity $_ -Category Application | select -ExpandProperty Tag).Name )}},
@{N="Platform";E={((Get-TagAssignment -Entity $_ -Category Platform | select -ExpandProperty Tag).Name )}},
@{N="PCI";E={((Get-TagAssignment -Entity $_ -Category PCI | select -ExpandProperty Tag).Name )}},
@{N="Environment";E={"Vmware Corp"}},
@{N="IP Address";E={@($_.Guest.IPAddress)}} |
ConvertTo-Csv -NoTypeInformation |
out-file "E:\Staging\ServerInventory\CSV\gswpvcnt001.csv"
The current issue is that all tag information cannot be pulled. The only information that is gathered and exported to a .csv file is the name, environment and ip address. No tagging information is provided.