PowerCLI-Example-Scripts icon indicating copy to clipboard operation
PowerCLI-Example-Scripts copied to clipboard

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

Open kushneo opened this issue 7 years ago • 3 comments
trafficstars

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

kushneo avatar Jan 26 '18 18:01 kushneo

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

mtelvers avatar Jan 26 '18 18:01 mtelvers

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"

salcinad avatar Sep 16 '21 12:09 salcinad

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

EvilRuin avatar Jun 05 '24 03:06 EvilRuin