The VMware Infrastructure Power Documenter (hereafter referred to as VIPD) is a nifty PowerShell script that queries VirtualCenter and produces reports of VM configurations, data center inventory, VM stats, etc. Last time I tried to install VIPD, though, I found the installation instructions seriously lacking. Today I had the opportunity to work with a customer to get this installed, and I wanted to share my information here. These instructions are not to be construed as the “official” way of making VIPD work, just what I had to go through in order for it to work.
First, you’ll need to download the prerequisites: Microsoft .NET Framework 3.5, OpenXML Formats SDK, PowerShell 1.0, and the VI Toolkit for PowerShell. As far as I can tell, you can install these in any order you want, other than being sure to install PowerShell before trying to install the VI Toolkit for PowerShell.
Second, copy the VIPD—specifically, the .PS1 file which is the script itself, the OpenXML PowerTools files, and the DOCX/XLSX formatting templates to a directory on the hard drive. I placed them in the default PowerShell installation directory, but I suppose they could be just about anywhere. The key thing I’ve found is that the script and the formatting templates need to be in the same directory.
Next, you need to add the OpenXML PowerTools—included with the VIPD download—so that PowerShell can use them. This is where it starts to get dicey. The instructions call for the use of a tool called InstallUtil, but the instructions don’t provide any information on where this tool is. I found a version that works in “C:\Windows\Microsoft.NET\Framework\v2.0.50727″. From a command prompt (not PowerShell, as the instructions say), change into that directory and run this command:
installutil <Full path to OpenXML Power Tools>\
OpenXml.PowerTools.dll
The instructions said to add another “\OpenXml.PowerTools” to the end of that command, but I couldn’t make it work that way.
Finally, you’ll need to ensure that PowerShell can run scripts (I believe the command is “Set-ExecutionPolicy RemoteSigned”). Once these steps are done, you should be good to go.
After using VIPD for a short while, I’ve also noticed that you can’t specify a full path for the output file; you can only specify a filename. This means the output file will be created in whatever directory you’re in when you run the script.
Anyone who has any additional information or clarification, please feel free to speak up in the comments.
Tags: Virtualization, VMware
-
VIPD is here:
http://communities.vmware.com/docs/DOC-7473 -
As another option here, I just wanted to give a nod to Alan Renouf’s take on reporting, which is here: http://communities.vmware.com/docs/DOC-7070
Alan’s report generator generates lots of nice charts and so forth. He even mentioned that he’s cooking up an export to Visio, so hopefully this will be the motivation he needs to get it done!
-
I am having some problems getting this to run. I followed your directions, and when i go to run the script, i am getting a message “Sorry. To run this script, you need to have installed the vmware toolkit and the OpenXmlPowerTools, which i have.
Any thoughts?
app
-
Hi, I tryed now 4 time to get this script running. I follow the given instruction for setup, but at my Systems I cant get this running. Everytime I try to start the Documenter script it says that I dont have the VMware Toolkit installed or the OpenXMLPowerTools which are both definately on my System, like even all other recommended Softwarepackages !?
-
Hi Slowe,
Thx for your fast feedback, I got it running now
my problem was that I have to run the VI-Toolkit Init first and then run ADD-PSSnapin with focus at it. Thx for your info that you dont have a suggesstion that brings me back too start thinkin about it again …in this case “PEBKAC”— problem exists between keyboard and chair
… Thx again and wish you Merry Christmas
-
I have followed all the instructions, but when I run the script (.\New-VMInfrastructureReport.ps1 -fileName “datacenterInventoryReportSample.docx” -outputType “wordprocessingml” -reportType “inventory” -wordStyleTemplate “wordprocessingmlStyleTemplate.docx” -company “ACME” -serverIp xxx.xxx.xxx.xxx -user root -password xxxxxx) I receive the following error message for word:
Export-OpenXmlWordprocessing : Could not load file or assembly ‘DocumentFormat.
OpenXml, Version=1.0.1803.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′
or one of its dependencies. The system cannot find the file specified.
At C:\scripts\New-VMInfrastructureReport.ps1:79 char:31
+ Export-OpenXmlWordprocessing <<<< -OutputPath $documentPath -Text ”
”
An error has occurred that was not properly handled. Additional information is s
hown below. The Windows PowerShell process will exit.And the following message for SpreadSheetML format( .\New-VMInfrastructureReport.ps1 -fileName “vmListReportSample.xlsx” -outputType “spreadsheetml” -reportType “vm” -spreadsheetStyleTemplate “spreadsheetmlStyleTemplate.xlsx” -company “ACME” -serverIp xxx.xxx.xxx.xxx -user root -password xxxxxx):
Export-OpenXmlSpreadsheet : A parameter cannot be found that matches parameter
name ‘SuppressBackups’.
At C:\scripts\New-VMInfrastructureReport.ps1:315 char:98
+ $vmList | Export-OpenXmlSpreadsheet -OutputPath $document
Path -InitialRow 7 -SuppressBackups <<<<An error has occurred that was not properly handled. Additional information is s
hown below. The Windows PowerShell process will exit.Template documents are in the same folder with the script. I have installed OpenXml.PowerTools.dll and execute Add-PSSnapin command before I start the script. Has anybody seen that issues?
-
Tuco, did you find any solution? I’m facing the same problem and I’m sure I followed every step in the installation.
-
I’m having the same problem as Tusco and Neotic. I can see that both libs are loaded properly in the PowerGUI script editor.
A parameter cannot be found that matches parameter name ‘SuppressBackups’.
At :line:315 char:97
+ $vmList | Export-OpenXmlSpreadsheet -OutputPath $documentPath -InitialRow 7 -SuppressBackups <<<<I’m guessing VMware changed something in their powershell toolkit.
-
I eventually managed to crack this, the key is to get the right version of the OpenXml.PowerTools.dll that matches the OpenXMLSDK version that you’ve downloaded and installed.
I downloaded the binaries from here - http://staffdotnet.com/services/powertools.html
And then I downloaded OpenXMLDSK v2.3302 from here:
http://www.f1cd.ru/soft/base/o/open_xml_format_sdk/open_xml_format_sdk_20_sep08/OpenXMLSDKv2.msiTo check the version of our DocumentFormat.OpenXml binary then check out C:\Windows\Assembly and you can see the version, once you get the same version that your error is throwing up hopefully it should all work…




12 comments
Comments feed for this article
Trackback link: http://blog.scottlowe.org/2008/12/05/installing-the-vi-power-documenter/trackback/