vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
743 stars 601 forks source link

get-hvmachinesummary : How to export Machine Name , User & the Status to a CSV File #159

Open kushneo opened 6 years ago

kushneo commented 6 years ago

By using get-hvmachinesummary , How can I export only the Machine Name , User & the Status to a CSV File ?

mtelvers commented 6 years ago

Something like this: Get-HVMachineSummary -HvServer $hvs -PoolName $pool | select -ExpandProperty Base | select Name, User, BasicState | Export-Csv -Path c:\path\my.csv

salcinad commented 2 years ago

This actually does not work. The User output is "VMware.Hv.UserOrGroupId" for all VDIs as seen below:

Name      User                    BasicState       
----      ----                    ----------       
VDI01 VMware.Hv.UserOrGroupId DISCONNECTED     
VDI02 VMware.Hv.UserOrGroupId DISCONNECTED     
VDI03 VMware.Hv.UserOrGroupId AVAILABLE 

Is there any way to get this User Info when using "Get-HVMachineSummar"

EvilRuin commented 4 weeks ago

Bump. Would like to know how to get user info with this command or Get-HVMachine