VMWare - Guest OS for msft SA compliance

kboparai1
New Contributor II

Hey all,
Recently, there has been an effort to get some stats on what msft vms we have running in office. We took a template https://jamfnation.jamfsoftware.com/viewProductFile.html?fid=167 and modified it to the point where it can count the number of vms for that specific guest os. See script for example..

I also checked out Rich's post on http://derflounder.wordpress.com/2012/12/18/pulling-guest-os-information-from-offline-vmware-fusion-...

Thought of a kludgie way by using smart groups to add up some vm's but was hoping someone has a better way?

#!/bin/sh
myVMList=`find /Users -name "*.vmx"`

IFS=$'
'
myCount=0
for myFile in $myVMList
do
myGuestOS=`cat "$myFile"| grep "guestOS"| sed 's/guestOS = //g'| sed 's/"//g'`

if [[ $myGuestOS == *windows7* ]]
then
  let myCount=myCount+1
fi
done
echo "<result>$myCount</result>"

unset IFS
0 REPLIES 0