Sample vSphere As Built report with health checks, using default report style.
Sample vSphere As Built report with health checks, using custom report style.
Below are the instructions on how to install, configure and generate a VMware vSphere As Built report.
The VMware vSphere As Built Report supports the following vSphere versions;
- vSphere 5.5
- vSphere 6.0
- vSphere 6.5
- vSphere 6.7
- vSphere 7.0
This report is compatible with the following PowerShell versions;
Windows PowerShell 5.1 | PowerShell Core | PowerShell 7 |
---|---|---|
✅ | ❌ | ❌ |
Windows PowerShell 5.1 and the following PowerShell modules are required for generating a VMware vSphere As Built report.
Each of these modules can be easily downloaded and installed via the PowerShell Gallery
The following role assigned privileges are required to generate a VMware vSphere As Built Report.
- Global > Licenses
- Global > Settings
- Host > CIM > CIM Interaction
- Host > Configuration > Change Settings
- Profile-driven Storage > Profile-driven storage view
- VMware vSphere Update Manager > View Compliance Status
Open a Windows PowerShell terminal window and install each of the required modules.
install-module VMware.PowerCLI -MinimumVersion 10.0 -AllowClobber
install-module AsBuiltReport.VMware.vSphere
The vSphere As Built Report utilises a JSON file to allow configuration of report information, options, detail and healthchecks.
A vSphere report configuration file can be generated by executing the following command;
New-AsBuiltReportConfig -Report VMware.vSphere -FolderPath <User specified folder> -Filename <Optional>
Executing this command will copy the default vSphere report JSON configuration to a user specified folder.
All report settings can then be configured via the JSON file.
The following provides information of how to configure each schema within the report's JSON file.
The Report schema provides configuration of the vSphere report information.
Sub-Schema | Setting | Default | Description |
---|---|---|---|
Name | User defined | VMware vSphere As Built Report | The name of the As Built Report |
Version | User defined | 1.0 | The report version |
Status | User defined | Released | The report release status |
ShowCoverPageImage | true / false | true | Toggle to enable/disable the display of the cover page image |
ShowTableOfContents | true / false | true | Toggle to enable/disable table of contents |
ShowHeaderFooter | true / false | true | Toggle to enable/disable document headers & footers |
ShowTableCaptions | true / false | true | Toggle to enable/disable table captions/numbering |
The Options schema allows certain options within the report to be toggled on or off.
Sub-Schema | Setting | Default | Description |
---|---|---|---|
ShowLicenseKeys | true / false | false | Toggle to mask/unmask vSphere license keys Masked License Key *****-*****-*****-56YDM-AS12K Unmasked License Key AKLU4-PFG8M-W2D8J-56YDM-AS12K |
ShowVMSnapshots | true / false | true | Toggle to enable/disable reporting of VM snapshots |
The InfoLevel schema allows configuration of each section of the report at a granular level. The following sections can be set.
There are 6 levels (0-5) of detail granularity for each section as follows;
Setting | InfoLevel | Description |
---|---|---|
0 | Disabled | Does not collect or display any information |
1 | Enabled / Summary | Provides summarised information for a collection of objects |
2 | Adv Summary | Provides condensed, detailed information for a collection of objects |
3 | Detailed | Provides detailed information for individual objects |
4 | Adv Detailed | Provides detailed information for individual objects, as well as information for associated objects (Hosts, Clusters, Datastores, VMs etc) |
5 | Comprehensive | Provides comprehensive information for individual objects, such as advanced configuration settings |
The table below outlines the default and maximum InfoLevel settings for each section.
Sub-Schema | Default Setting | Maximum Setting |
---|---|---|
vCenter | 3 | 5 |
Cluster | 3 | 4 |
ResourcePool | 3 | 4 |
VMHost | 3 | 5 |
Network | 3 | 4 |
vSAN | 3 | 4 |
Datastore | 3 | 4 |
DSCluster | 3 | 4 |
VM | 2 | 4 |
VUM | 3 | 5 |
The Healthcheck schema is used to toggle health checks on or off.
The vCenter schema is used to configure health checks for vCenter Server.
The Cluster schema is used to configure health checks for vSphere Clusters.
The VMHost schema is used to configure health checks for VMHosts.
The vSAN schema is used to configure health checks for vSAN.
Schema | Sub-Schema | Setting | Default | Description | Highlight |
---|
The Datastore schema is used to configure health checks for Datastores.
Sub-Schema | Setting | Default | Description | Highlight |
---|---|---|---|---|
CapacityUtilization | true / false | true | Highlights datastores with storage capacity utilization over 75% | 75 - 90% utilized >90% utilized |
The DSCluster schema is used to configure health checks for Datastore Clusters.
The VM schema is used to configure health checks for virtual machines.
# Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Users\Tim\Documents'
PS C:\> New-AsBuiltReport -Report VMware.vSphere -Target 'vcenter-01.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -Format Html,Word -OutputFolderPath 'C:\Users\Tim\Documents' -Timestamp
# Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' using specified credentials and report configuration file. Export report to Text, HTML & DOCX formats. Use default report style. Save reports to 'C:\Users\Tim\Documents'. Display verbose messages to the console.
PS C:\> New-AsBuiltReport -Report VMware.vSphere -Target 'vcenter-01.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -Format Text,Html,Word -OutputFolderPath 'C:\Users\Tim\Documents' -Verbose
# Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' using stored credentials. Export report to HTML & Text formats. Use default report style. Highlight environment issues within the report. Save reports to 'C:\Users\Tim\Documents'.
PS C:\> $Creds = Get-Credential
PS C:\> New-AsBuiltReport -Report VMware.vSphere -Target 'vcenter-01.corp.local' -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Tim\Documents' -EnableHealthCheck
# Generate a single vSphere As Built Report for vCenter Servers 'vcenter-01.corp.local' and 'vcenter-02.corp.local' using specified credentials. Report exports to WORD format by default. Apply custom style to the report. Reports are saved to the user profile folder by default.
PS C:\> New-AsBuiltReport -Report VMware.vSphere -Target 'vcenter-01.corp.local','vcenter-02.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -StyleFilePath 'C:\Scripts\Styles\MyCustomStyle.ps1'
# Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail.
PS C:\> New-AsBuiltReport -Report VMware.vSphere -Target 'vcenter-01.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -Format Html,Word -OutputFolderPath 'C:\Users\Tim\Documents' -SendEmail