Freitag, 10. Juli 2015

Which vSphere VMs are running with the wrong OS ? How to ask per Powershell.

The VMware Tools message their running OS to the vCenter, this captures only VMs where the Tools are properly running.

PS H:\> get-view -viewtype virtualmachine -Filter @{"Guest.ToolsRunningStatus" = 'guestToolsRunning'} Where-Object {-not ($_.Config.GuestID -eq $_.Guest.GuestId)}|select name

Or as ; seperated CSV File.

PS H:\> get-view -viewtype virtualmachine -Filter @{"Guest.ToolsRunningStatus" = 'guestToolsRunning'} Where-Object {-not ($_.Config.GuestID -eq $_.Guest.GuestId)}|%{-join('"',$_.Name,'";"',$_.Config.GuestID,'";"',$_.Guest.GuestID,'"')}|Out-File 'h:\wrongGuest.csv'

Keine Kommentare:

Kommentar veröffentlichen