Back in the days when we had GSX and ESX 2.5 I got tired of trying to keep any kind of document up to date with what VMs were running where. So I came up with this visio doc which has some code behind it. It works by querying a specified group in Active Directory to get the list of host machines to check and then draws the hosts and their guests.
The file is here: vm_report.vsd
There are a few requirements and assumptions:
- IADSTools.dll needs to be installed/available on the machine. This is included in the Win2K Support Tools kit. See MS KB article 246530.
- requires the VMcom API Available from VMware. (This is (or used to be) an installable option with GSX)
- Assumes you’ve created a group in Active Directory that has all the hosts you want to check as members. The machines don’t have to be members of the domain but in that case you do have to have dummy computer object entries for them in AD. Look at creating dummy computer accounts for more info about this.
- Assumes you use a consistent userid/password combination for your ESX hosts, and also that whatever account you specify for GSX access has the necessary permissions. (please type passwords in carefully as any typos may cause you to lock out your account depending on your local security policy)
- Open the file VM_report.vsd (depending on your security level, you may have to enable macros).
- Navigate to Tools->Macros->Visual Basic Editor (or press Alt+F11) to open the Code editor.
- In the upper left corner of the screen you should see the project explorer window. If necessary expand the Visio Objects folder and right-click on ThisDocument. Choose the View Code option from the context menu.
- Set the values for VMHostGroupDN and MaxNumGuests appropriately.
- Either use the File Menu or hit ctrl-S to save the updates.
- Hit Alt+Q to return to Visio
To Configure the doc:
To Run the Macro:
1) To start the macro open the VSD file. (depending on the security level, you may have to enable macros) Go to the Tools Menu (Tools-> Macros -> This Document -> Draw_VM_Env)
You should see a box that prompts you for login information:
The script typically takes a few minutes to run.Below is some sample output. In this case we have 5 hosts that were checked. 2 GSX, 2 ESX and one other we weren’t actually able to connect to. This could either be because the machine wasn’t available/reachable, or none of the password/user combinations we provided were correct for this particular box.


Recent Comments