Hi all,
This tool is most excellent. It can produce detailed, or more detailed, or most detailed reports of your vSphere environment.
I should mention that when I use setting 2 for detail I get a Word document that is 9 pages long but when I use the default of 3, I get a report of 114 pages. But very good info and useful for a variety of reasons - such as DR, or helping with patching or VMware Tools updates. If I was still an SE for partners I would be using this script every time I finished working at a customer so I could also compare between when I finished the work and when I showed up to help troubleshoot.
The tool is call As Built Report and it comes from this site, but you can also see their VMworld session too.
Anyone is is experienced with PowerShell / PowerCLI is going to find it pretty easy. But I am a beginner, and I have not worked with JSON before so I stumbled a bit. So I am going to share a little bit of into to help people that might stumble as well.
Install outline
install-module AsBuiltReport
And yes, this means if you do update-module it will update things. This will also install all of the modules that AsBuilt has even though I will only use the vSphere one.
Execution - first
The command below is what you need to use the first time. And answer all the questions like your name, email and the like.
New-AsBuiltReport -Report VMware.vSphere -Target your_VC_FQDN -Credential (get-credential) -Format HTML,Word -OutputPath ‘C:\reports’ -TimeStamp -EnableHealthchecks
You can change the C:\Reports to what you need. I really like the TimeStamp feature as it means reports will not overwrite each other!
Make sure to answer all the questions and remember the path you select to save things.
Execution - next time
This will not prompt you for things but rather just execute. You can always start as above to reenter your configuration.
New-AsBuiltReport -Report VMware.vSphere -Target Your_VC_FQDN -Credential (get-credential) -Format HTML,Word -OutputPath ‘C:\reports’ -TimeStamp -EnableHealthchecks -AsBuiltConfigPath c:\scripts\AsBuiltReport.json
It is the -AsBuiltConfigPath that is what makes sure you are not prompted for a bunch of config stutff.
Using AsBuiltReport with customers?
You could use the parameter -ReportConfigPath - which is normally optional - to sepecify a different config so the mail server, titles and like would match the customer you are working at. So you do the first time above, then next time use specific the ReportConfigPath to select the right config for the customer
Changing Level of Detail
As I mentioned my first run gave me a report on my vSphere Infrastructure that was most excellent but also 114 pages. I wanted less detail.
- You stored your JSON likely in your home folder - so in my case it was c:\users\mwhite\AsBuiltReport\VMware.vSphere.json.
- Use Notepad++ or something similar to edit the vSphere.json file. It will look something like below.
In the InfoLevel area you can see above all the 3’s. You can change them to 2 and that will make a big difference in document size. You can change the number to what works for you and save the json file and the next run of the script will use the new values.
Multiple vCenters
You can put a second vCenter on the target line - which would make it look like:
New-AsBuiltReport -Report VMware.vSphere -Target Your_VC_FQDN,Other_vC_FQDN -Credential (get-credential) -Format HTML,Word -OutputPath ‘C:\reports’ -TimeStamp -
EnableHealthchecks -AsBuiltConfigPath c:\scripts\AsBuiltReport.json
This should get you going, but if you have questions or comments let me know.
Updates
- 10/26/19 - New URL for AsBuiltReport - https://www.asbuiltreport.com.
- 7/6/19 - big changes! Now AsBuiltReport is in the Gallery.
- 3/12/19 - added the info on how you can do multiple vCenters.
- 3/9/19 - used the latest version - as of today - PowerCLI, Powershell, and the As Built scripts. Also fixed some typos and grammar. I also noticed the vSphere JSON has a default of 3’s now where it used to be 2’s so that is a nice change - so my 114 page report is now 34.
Michael
=== END ===
Hi,
Very nice guide. I have a question regarding your home lab. How many vms and hosts do you have in your lab that produces a report of 114 pages ( or 9 pages with level 2 ). Why Im asking is because I am thinking of using this is our production environment to get a full report. But the production environment contains a couple of hundred vms and a bunch of hosts so im afraid im gonna get a huge report that will crash my disk.
Regards,
Johan
Hi Johan,
Yes, I suspect you will have a very large doc. I have only 4 hosts and maybe 40 or 50 VMs so you will have something pretty big, but I suspect it will still be useful. there will hot links, and you can always do ctrl F.
Michael
Hi Michael,
How to install-module AsBuiltReport in offline environment where no public network access.
You can download stuff from the gallery on another machine and copy it to where you need it. I have not done that but am told that is possible. Maybe try Google. Let me know how it goes.
Michael
Hello,
I tried to used for generating report from multiple VMware vCentre. Both Vcenter are in the same doamin. I used this command:
New-AsBuiltReport -Report VMware.vSphere -Target server1.local,server2.local -Credential (Get-Credential) -Format HTML,Word -OutputPath ‘C:\users\xxxx\desktop\reporty\’ -TimeStamp
The result is
Invoke-AsBuiltReport.VMware.vSphere : 21.9.2019 3:33:25 Connect-VIServer Cannot complete login due to an incorrect user name or password.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Core\1.0.1\Src\Public\New-AsBuiltReport.ps1:307 char:13
+ & “Invoke-$($ReportModule)” -Target $Target -Credential $ …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-AsBuiltReport.VMware.vSphere
Report is generated only for server1.
Sounds like the credentials for server2 are not right. Maybe try doing just server2 to see if that is correct.
Michael
Hello Michael,
I am trying to use New-AsBuiltReport -Report VMware.vSphere on a VMware host that is not connected to a vceneter. Can I use the AsBuiltReport.VMware.vSphere module to run on a stand alone ESXI host or is there another module I should use to get a report ?
Hi Paul, I don’t think AsBuilt will work with hosts at this time. I suggest something different that you can learn about here - https://notesfrommwhite.net/2017/08/16/document-your-vsphere-environment-yes-you-can/ - it works good and I like it.
Michael
Hello Michael,
Thank you for sharing the link to run Inventory reports from an ESXI host. It is very similar to the RVTools windows application which can provide a lot more detail on your ESXI host and then export to a Excel spreadsheet. That’s what lead me to AsBuilt as I wanted to create a document which I could present to my customer. Could you create a module to pull a report from a standalone ESXI host. I have a system to test if you need.
Thanks again
Paul
HI Paul,
I am not the author of As Built, but you can find them here https://www.timcarman.net/as-built-report/ - I would not be suprised if they might add in what you want in the future. I will also mention it to them.
Michael
OK, I have heard that this capability - use host rather than vCenter for source, is on the roadmap. No committtment when it will be done but it is on the list.
Michael