Wondering if anyone could point me to a script available or the correct line to pull out the Operating System info associated against all the VM's in VC. I seem to have a load of scripts but none appear to give me that specific info. Any help appreciated.
Cheers
H
That's because that line returns the GuestFamily.
Use the GuestId property to get the OS name as VI knows it.
$vms = get-vm | get-view foreach($vm in $vms){ write-host $vm.Name $vm.guest.GuestId }
If you want the guest OS as reported by the (Windows) Os itself you can use the command from this thread .
PS: the end tag for doesn't need a backslash. Just place your code between two identical tags.
I find that ...... works best. Without the blanks of course.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you try the command in ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD, you must live on this site LOL. Thankfully for mewbies like me.
get-vm | %{get-view $_.ID} | %{write-host $_.Name $_.guest.GuestFamily}
Just tried that line and it returns all my VM's with WindowsGuest against them. Is there something I need to add in to specify the acutal OS type. I appreciate the help.
H
That's because that line returns the GuestFamily.
Use the GuestId property to get the OS name as VI knows it.
$vms = get-vm | get-view foreach($vm in $vms){ write-host $vm.Name $vm.guest.GuestId }
If you want the guest OS as reported by the (Windows) Os itself you can use the command from this thread .
PS: the end tag for doesn't need a backslash. Just place your code between two identical tags.
I find that ...... works best. Without the blanks of course.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the help much appreciated.