asbuiltreport / asbuiltreport.vmware.vsphere Goto Github PK
View Code? Open in Web Editor NEWRepository for AsBuiltReport VMware vSphere module
Home Page: https://www.asbuiltreport.com
License: MIT License
Repository for AsBuiltReport VMware vSphere module
Home Page: https://www.asbuiltreport.com
License: MIT License
Hello, receiving a "Cannot validate argument" error when running New-AsBuiltReport command. This is only happening when I try to use the -ReportConfigPath and -AsBuiltConfigPath parameters. If I don't include these parameters the report is generated correctly.
The path and files specified by -ReportConfigPath and -AsBuiltConfigPath are correct and the json files were actually generated by running the command and saving the files during the prompts.
Command: New-AsBuiltReport -Target vcentername -Credential $mycred -Report VMware.vSphere -Format Html,Word -ReportConfigPath 'C:\Scripts\Config\AsBuiltReport.json' -AsBuiltConfigPath 'C:\Scripts\Config\AsBuiltReport.VMware.vSphere.json' -OutputPath 'C:\Scripts\Output\ASBuilt' -Timestamp
Error: Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At line:1 char:1
Expected behavior
I expected the command to accept the input for the parameters as configuration and run the report.
System (please provide the following information about the system from which you are trying to generate a report):
Describe the bug
You cannot call a method on a null-valued expression error after getting to this section:
VERBOSE: [ 16:24:39:335 ] [ Document ] - Processing section 'DSC - Trusted Colours' completed.
VERBOSE: [ 16:24:39:350 ] [ Document ] - Processing section 'Datastore Clusters' completed.
VERBOSE: [ 16:24:39:350 ] [ Document ] - Processing section 'Virtual Machines' started.
VERBOSE: [ 16:24:39:366 ] [ Document ] - Processing paragraph 'The following sections detail the co[..]'.
VERBOSE: [ 16:24:39:366 ] [ Document ] - Processing blank line.
New-AsBuiltReport : You cannot call a method on a null-valued expression.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
To Reproduce
Steps to reproduce the behavior:
New-AsBuiltReport -Report VMware.vSphere -Target 172.22.xxx.yyy -Username username -Password password OutputPath 'd:\Reports'
The licencing section is set to false in the json due to causing the report to fail.
Expected behavior
Report to be generated
Screenshots
VERBOSE: [ 16:24:39:335 ] [ Document ] - Processing section 'DSC - Trusted Colours' completed.
VERBOSE: [ 16:24:39:350 ] [ Document ] - Processing section 'Datastore Clusters' completed.
VERBOSE: [ 16:24:39:350 ] [ Document ] - Processing section 'Virtual Machines' started.
VERBOSE: [ 16:24:39:366 ] [ Document ] - Processing paragraph 'The following sections detail the co[..]'.
VERBOSE: [ 16:24:39:366 ] [ Document ] - Processing blank line.
New-AsBuiltReport : You cannot call a method on a null-valued expression.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
PS H:> $global:error[1]
You cannot call a method on a null-valued expression.
At C:\Program
Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\Src\Public\Invoke-AsBuiltReport.VMware.vSphere.ps1:3421
char:64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PS H:>
System (please provide the following information about the system from which you are trying to generate a report):
$PSVersionTable.PSVersion
]PS H:> $PSVersionTable.PSVersion
Major Minor Build Revision
5 1 14393 2969
AsBuiltReport Core 1.0.0 AsBuiltReport.Core
AsBuiltReport Report module name and version 1.1.0 AsBuiltReport.VMware.vSphere0.0]
Describe the bug
vSphere 8.0 U1c Build 22088981 - New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection.
To Reproduce
Steps to reproduce the behavior:
System (please provide the following information about the system from which you are trying to generate a report):
Describe the bug
Every time I run the report I get the same error. I've tried it a bunch of different ways, even on different machines. Its obviously connecting to the vCenter because I see cluster names in the output. I've tried on different vCenters with the same result. I always get this error after "Processing section 'Boot Device' started."
New-AsBuiltReport : Cannot convert value "N/A" to type "System.Int32". Error: "Input string was not in a correct format."
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
To Reproduce
Steps to reproduce the behavior:
Run the script just like provided in the examples. This is a redacted version of the same command I'm using:
New-AsBuiltReport -Target 'vcsa.domain.local' -Username '[email protected]' -Password 'xxxxxxx' -Report VMware.vSphere -Format Html,Word -OutputPath 'C:\Users\MyAccount\Desktop\GeneratedAsBuilts' -Timestamp
Expected behavior
System (please provide the following information about the system from which you are trying to generate a report):
Additional context
This is failing "out of the box" right after newly installing the modules on a machine. Please help!
Getting an error when running this command
[SP]> Invoke-AsBuiltReport.VMware.vSphere -Target xxxxxxxxxx -Credential xxxxxxxxxxxxxxx
The variable '$pscriboDocument' cannot be retrieved because it has not been set.
At line:51 char:9
$pscriboDocument.Properties['Sections']++;
~~~~~~~~~~~~~~~~
Id :
Level : 0
Number :
Name :
Type : PScribo.Section
Style : Heading1
Tabs : 0
IsExcluded : False
Sections : {}
Orientation : Portrait
IsSectionBreak : False
IsSectionBreakEnd : False
vSAN 8 ESA has no disk groups anymore. The argument is NULL or empty
Perhaps you can skip the vSAN disk group information in the script ?
Update:
Test with the RC run into the same error:
ModuleType Version Name ExportedCommands
Script 1.3.4 AsBuiltReport.VMware.vSphere Invoke-AsBuiltReport.VMware.vSphere
New-AsBuiltReport : The argument for the VsanDiskGroup parameter cannot be verified. The argument is NULL or empty. Provide an argument that is not NULL or empty, and
run the command again.
In line:1 character:1
+ CategoryInfo : NotSpecified: (:) [Write Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
ESXi 8.0.2 Build 22380479
vCenter 8.0.2 Build 22385739
Name Value
PSVersion 5.1.19041.3693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
VMware Common PowerCLI Component 13.2 build 22643733
VMware Cis Core PowerCLI Component PowerCLI Component 13.2 build 22643734
VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 13.2 build 22643732
VMware VimAutomation Storage PowerCLI Component PowerCLI Component 13.2 build 22643728
VMware VimAutomation Vds Commands PowerCLI Component PowerCLI Component 13.1 build 21610933
I have just freshly installed the required modules for this today, & here is the entry that gets this error.
New-AsBuiltReport -Target 'vcenterserver.tesi.local' -Credential $Creds -Report VMware.vSphere -Format Html,Text -OutputPath 'C:\Reports' -EnableHealthCheck
then gives me
New-AsBuiltReport : A parameter cannot be found that matches parameter name 'Name'.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
Describe the bug
Running as built vsphere report on venter 6.7 u2 and get : Cannot bind argument to parameter 'Rows' because it is an empty collection. just after the processing licensing
To Reproduce
Steps to reproduce the behavior:
New-AsBuiltReport -Report VMware.vSphere -Target 111.222.333.444 -Username vcheck -Password z********** -Format HTML,Word -OutputPath 'd:\Reports'
Expected behavior
Report output into d:\reports.
System (please provide the following information about the system from which you are trying to generate a report):
5 1 14393 2969
3rd party PowerShell module name and version
VMware PowerCLI 10.0.0 build 7895300
AsBuiltReport Core 1.0.0 AsBuiltReport.Core
AsBuiltReport Report module name and version 1.1.0 AsBuiltReport.VMware.vSphere
New Feature Request:
It would be really useful to have an IP address Report as part of the export. This would allow for easy input into a IPAM, spread sheet, DB, etc. The idea would be to have this in a list of individual IPs. So each IP address would be on a line/row of its own.
Maybe the columns would be something like below.
IP(v4/v6),VMName,vNIC,VLAN#,Port-GroupName,vSwitch/dvSwitch,Host,Cluster,Location
Report generation crashed with the following error when attempting to collect ESXi Host Datastore Specifications.
Cannot bind argument to parameter 'Rows' because it is an empty collection.
Issue appears to be a missing if
statement when collecting ESXi host datastore information. Currently code assumes all ESXi hosts will have a datastore. In this particular case, the report crashes when it tries to retrieve information from a vSAN witness.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If a host does not have any datastores, the script should bypass collection
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
I have a client requesting the report include specific settings related to the iSCSI software storage adapter. Additional settings I would like to add to the report on the iSCSI software storage adapter..
Authentication Method
Authentication Method Account Name
Advanced Options
Network Port Binding - (Port Group, vmk adapter, Port Group Policy, Path Status, Physical Network Adapter)
Targets - Dynamic Discovery (iSCSI server list)
Describe the solution you'd like
I would like to know how to amend the script to include the above.
Describe alternatives you've considered
No alternatives considered. Reviewed Invoke-AsBuiltReport.VMware.vSphere.ps1 but not sure how to alter code to get what I need.
Additional context
No other context.
Thanks for your assistance.
Host count on distributed virtual switches reports as zero in vSphere 6.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Distributed virtual switches should show the correct number of connected ESXi hosts
Generating a VMware vSphere As Built Report with vCenter InfoLevel = 5 fails when reporting the vCenter Alarms.
This issue is due to some alarms within vCenter Server 8.0 not having an Alarm name defined.
Alarm | Description | Enabled | Entity | Trigger | Trigger Info |
---|---|---|---|---|---|
Enabled | Datacenter | SendSNMP:Green->Yellow (Repeat=False) | -- | ||
Enabled | Datacenter | SendSNMP:Yellow->Red (Repeat=False) | -- | ||
Enabled | Datacenter | SendSNMP:Red->Yellow (Repeat=False) | -- | ||
Enabled | Datacenter | SendSNMP:Yellow->Green (Repeat=False) | -- |
This can be corrected by modifying
$Alarms = $Alarms | Sort-Object 'Alarm', 'Trigger'
and changing it to
$Alarms = ($Alarms).Where{ $_.alarm -ne "" } | Sort-Object 'Alarm', 'Trigger'
Describe the bug
The As Built Report for vSphere is unable to determine privileges of user running the report if they receive privileges via a group (eg Active Directory group) rather than directly assigned.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
As built report should be aware of privileges allocated via AD group.
Screenshots
If applicable, add screenshots to help explain your problem.
System (please provide the following information about the system from which you are trying to generate a report):
Additional context
Code in Invoke-AsBuiltReport.VMware.vSphere.ps1 beginning line 50 can be changed to instead check the effective user privileges rather than looking for directly assigned role.
For example, to get a list of the effective privileges at the top level in vCenter, you could use code like this. Then you can compare that list against the expected required privilege for a given piece of information (eg Global.Licenses for the ESXi licenses"
$AuthMgr = Get-View $($vCenter.ExtensionData.Content.AuthorizationManager)
$Privileges = $authMgr.FetchUserPrivilegeOnEntities("Folder-group-d1", $vCenter.User)
Describe the bug
When generating a VMware vSphere As Built Report against a vSphere 6.0 environment, the script terminates with the following error New-AsBuiltReport : You cannot call a method on a null-valued expression.
The issue has been isolated to the Get-License
function when retrieving vCenter Server license information. It also appears that the problem is isolated to some vSphere 6.0 environments.
Expected behavior
VMware vSphere report should be generated without error and show valid vCenter Server licensing information.
System (please provide the following information about the system from which you are trying to generate a report):
$PSVersionTable.PSVersion
] 5.1.17763.316Additional context
Add any other context about the problem here.
If the report is generated using the vcenter ip address as -Target the $_.Entity.Name is equal as the IP instead of the vcenter FQDN
PS /home/rebelinux> $VIMachineCertificates = Get-VIMachineCertificate -Server 192.168.5.2
PS /home/rebelinux> $VIMachineCertificates
Entity Subject Issuer NotValidAfter
------ ------- ------ -------------
192.168.5.2 vcenter-01v.pharmax.local pharmax-SERVER-DC-01V-CA 1/25/2024 8:33:…
esxsvr-00f.pharmax.local esxsvr-00f.pharmax.local vcenter-01v 5/21/2025 11:50…
comp-02a.pharmax.local comp-02a.pharmax.local vcenter-01v 5/28/2026 8:35:…
comp-01a.pharmax.local comp-01a.pharmax.local vcenter-01v 5/31/2026 11:45…
PS /home/rebelinux> $VIMachineCertificates.Entity.Name
192.168.5.2
esxsvr-00f.pharmax.local
comp-02a.pharmax.local
comp-01a.pharmax.local
PS /home/rebelinux>
If a fix is not possible, it would be a good idea to update the documentation to state that the FQDN of the vcenter should be used.
Is your feature request related to a problem? Please describe.
Currently the VMware vSphere as built report lacks summarised information for each section.
Describe the solution you'd like
Add additional code which aligns to InfoLevel 1 to provide summary information for each section
Describe the bug
In the section for host physical adapters, the report currently only shows the name of a virtual standard switch (vSwitch) that a vmnic is associated with. If the vmnic is associated with a distributed switch, it is not shown here.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
This table should list the name of the switch the vmnic is associated with whether is be a standard or distributed switch.
System (please provide the following information about the system from which you are trying to generate a report):
If the vCenter is connected with PowerCLI by IP and FQDN the SDRS VM Overrides table of the Datastore Cluster section display duplicate VMs entries.
PowerCLI connected vCenter (both entry point to the same vCenter):
[DBG]: PS /home/rebelinux> $global:DefaultVIServers
Name Port User
---- ---- ----
vcenter-01v.pharmax.local 443 VSPHERE.LOCAL\Administrator
192.168.5.2 443 VSPHERE.LOCAL\Administrator
[DBG]: PS /home/rebelinux>
VMWARE_VDI_DATASTORE - SDRS VM Override with Duplicate entries:
SSD-HIGH-PERF - SDRS VM Override with Duplicate entries:
Describe the bug
XML Report Output allows XML tag names to start with a Number which is not allowed by standards and causes errors when trying to use or view it.
To Reproduce
Steps to reproduce the behavior:
Create a VMware report using something like:
New-AsBuiltReport -Target 'vcenter-01.corp.local','vcenter-02.corp.local' -Username 'An_Administrator' -Password 'Password' -Report VMware.vSphere -Format Html,XML -OutputPath 'C:\Users\Tim\Documents' -EnableHealthCheck
When finished, open the XML report in another XML viewer or editor such as XML Editor, Excel, Visual Studio, etc...
It will either fail to load or show errors when loaded. See screenshots below
Expected behavior
A usable XML file that can be imported or manipulated in other tools without errors.
System:
Suggestions:
A quick web search found a couple of ways to "fix" this:
Prepend all of the XML "names" with something like an _ to make it valid - ex. <_8112c111-d06a-42e7-8bbd-0e70670a153b name="vcsa.qa.dmz">
Haven't dug into your code to see if it is being used as anything other than a simple random tracker for the XML, but change it to use something else to create the random tag name or adjust the code so that it doesn't allow the random tag name to begin with number
If still want to use the number, you can just encode the first char to use the hex equivalent no matter if it is alpha or numeric (ex x0038 to represent 8) as seen in this stackoverflow thread. This would make it harder to "look" at and since it is non-standard, it might cause additional issues or weirdness when other XML tools might not handle it properly as seen in this thread.
Obviously I think that option 1 would be the easiest and quickest fix, but since I haven't looked into the code, I don't know if it would cause other issues.
Describe the bug
This is the error (I removed the servername)
New-AsBuiltReport : The variable '$Images' cannot be retrieved because it has not been set.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
To Reproduce
Steps to reproduce the behavior:
Running New-AsBuiltReport against Vsphere
Expected behavior
I expected the report to be generated
Screenshots
If applicable, add screenshots to help explain your problem.
System (please provide the following information about the system from which you are trying to generate a report):
$PSVersionTable.PSVersion
]5 1 17763 3770
3rd party PowerShell module name and version [e.g. VMware PowerCLI 11.2]
VMware.PowerCLI 13.1.0 build 21624340
AsBuiltReport Core module version [e.g. 1.0.0]
1.3.0 AsBuiltReport.Core
1.3.3.1 AsBuiltReport.VMware.vSphere
Additional context
Add any other context about the problem here.
Good Afternoon,
This is my first time trying to run this report and I'm running into an issue on mulitple vCenters that I can't seem to move past. I've tried using both the IP address as well as the FQDN of the vCenter with no success.
New-AsBuiltReport : You cannot call a method on a null-valued expression.
ModuleType Version Name ExportedCommands
Manifest 1.0.0 AsBuiltReport
Script 0.2.0 AsBuiltReport.Cisco.UcsManager Invoke-AsBuiltReport.Cisco.UcsManager
Script 1.0.0 AsBuiltReport.Core {New-AsBuiltReport, New-AsBuiltConfig, New-AsBuiltReportConfig}
Script 0.4.1 AsBuiltReport.PureStorage.FlashA... Invoke-AsBuiltReport.PureStorage.FlashArray
Script 0.4.1 AsBuiltReport.VMware.NSXv Invoke
vSphere 6.5 Build 8815520
Powershell Version 5.1 Build 14409 Revision 1018
New-AsBuiltReport -Target 'VCNAME' -Username 'USERNAME' -Password 'PASSWORD' -Report VMware.vSphere -Format Html,Word -OutputPath 'C:\TEMP' -Timestamp
VERBOSE: [ 12:35:53:743 ] [ Document ] - Document 'VMware vSphere As Built Report - 2019-05-20_12.35.53' processing started.
VERBOSE: [ 12:35:53:844 ] [ Document ] - Setting global document options.
VERBOSE: [ 12:35:53:845 ] [ Document ] - Enabling section/heading numbering.
VERBOSE: [ 12:35:53:846 ] [ Document ] - Setting default font(s) to 'Arial'.
VERBOSE: [ 12:35:53:847 ] [ Document ] - Setting page top margin to '25.05'mm.
VERBOSE: [ 12:35:53:852 ] [ Document ] - Setting page right margin to '25.05'mm.
VERBOSE: [ 12:35:53:853 ] [ Document ] - Setting page bottom margin to '25.05'mm.
VERBOSE: [ 12:35:53:854 ] [ Document ] - Setting page left margin to '25.05'mm.
VERBOSE: [ 12:35:53:858 ] [ Document ] - Setting page size to 'A4'.
VERBOSE: [ 12:35:53:859 ] [ Document ] - Setting page orientation to 'Portrait'.
VERBOSE: [ 12:35:53:861 ] [ Document ] - Setting page height to '297'mm.
VERBOSE: [ 12:35:53:863 ] [ Document ] - Setting page width to '210'mm.
VERBOSE: [ 12:35:53:864 ] [ Document ] - Setting document style 'Title'.
VERBOSE: [ 12:35:53:870 ] [ Document ] - Setting document style 'Title2'.
VERBOSE: [ 12:35:53:872 ] [ Document ] - Setting document style 'Title3'.
VERBOSE: [ 12:35:53:875 ] [ Document ] - Setting document style 'Heading1'.
VERBOSE: [ 12:35:53:877 ] [ Document ] - Setting document style 'Heading2'.
VERBOSE: [ 12:35:53:880 ] [ Document ] - Setting document style 'Heading3'.
VERBOSE: [ 12:35:53:888 ] [ Document ] - Setting document style 'Heading4'.
VERBOSE: [ 12:35:53:891 ] [ Document ] - Setting document style 'Heading5'.
VERBOSE: [ 12:35:53:897 ] [ Document ] - Setting document style 'H1ExcludeTOC'.
VERBOSE: [ 12:35:53:900 ] [ Document ] - Setting document style 'Normal'.
VERBOSE: [ 12:35:53:902 ] [ Document ] - Setting document style 'TOC'.
VERBOSE: [ 12:35:53:904 ] [ Document ] - Setting document style 'TableDefaultHeading'.
VERBOSE: [ 12:35:53:908 ] [ Document ] - Setting document style 'TableDefaultRow'.
VERBOSE: [ 12:35:53:913 ] [ Document ] - Setting document style 'TableDefaultAltRow'.
VERBOSE: [ 12:35:53:916 ] [ Document ] - Setting document style 'Critical'.
VERBOSE: [ 12:35:53:918 ] [ Document ] - Setting document style 'Warning'.
VERBOSE: [ 12:35:53:920 ] [ Document ] - Setting document style 'Info'.
VERBOSE: [ 12:35:53:922 ] [ Document ] - Setting document style 'OK'.
VERBOSE: [ 12:35:53:925 ] [ Document ] - Setting table style 'TableDefault'.
VERBOSE: [ 12:35:53:928 ] [ Document ] - Setting table style 'Borderless'.
VERBOSE: [ 12:35:53:930 ] [ Document ] - Processing blank line.
VERBOSE: [ 12:35:53:932 ] [ Document ] - Processing paragraph 'VMware vSphere As Built Report'.
VERBOSE: [ 12:35:53:934 ] [ Document ] - Processing blank line.
VERBOSE: [ 12:35:53:937 ] [ Document ] - Processing table 'Cover Page'.
VERBOSE: [ 12:35:53:940 ] [ Document ] - Processing page break.
VERBOSE: [ 12:35:53:947 ] [ Document ] - Processing table of contents 'Table of Contents'.
VERBOSE: [ 12:35:53:950 ] [ Document ] - Processing page break.
VERBOSE: [ 12:36:04:950 ] [ Document ] - Processing section '***' started.
VERBOSE: [ 12:36:04:992 ] [ Document ] - Processing section 'vCenter Server' started.
VERBOSE: [ 12:36:05:005 ] [ Document ] - Processing paragraph 'The following section provides infor[..]'.
VERBOSE: [ 12:36:05:006 ] [ Document ] - Processing blank line.
VERBOSE: [ 12:36:05:355 ] [ Document ] - Processing table 'redacted vCenter Server Detailed Information'.
VERBOSE: [ 12:36:05:406 ] [ Document ] - Processing section 'Database Settings' started.
VERBOSE: [ 12:36:05:471 ] [ Document ] - Processing table 'redacted vCenter Server Database Configuration'.
VERBOSE: [ 12:36:05:494 ] [ Document ] - Processing section 'Database Settings' completed.
VERBOSE: [ 12:36:05:498 ] [ Document ] - Processing section 'Mail Settings' started.
VERBOSE: [ 12:36:05:600 ] [ Document ] - Processing table 'redacted vCenter Server Mail Configuration'.
VERBOSE: [ 12:36:05:611 ] [ Document ] - Processing section 'Mail Settings' completed.
VERBOSE: [ 12:36:05:613 ] [ Document ] - Processing section 'Historical Statistics' started.
VERBOSE: [ 12:36:06:417 ] [ Document ] - Processing table 'redacted vCenter Server vHistorical Statistics'.
VERBOSE: [ 12:36:06:457 ] [ Document ] - Processing section 'Historical Statistics' completed.
VERBOSE: [ 12:36:06:460 ] [ Document ] - Processing section 'Licensing' started.
New-AsBuiltReport : You cannot call a method on a null-valued expression.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
Generating a VMware vSphere As Built Report with VMHost InfoLevel >=3 fails when collecting PCI Device information from VMware ESXi 8.0 hosts.
During investigation it has been found that the following code does not return any results on an ESXi 8.0 host, but has worked previously on ESXi 7.0 U3 hosts.
$vmhost = get-vmhost labesxi1.lab.local
$esxcli = Get-EsxCLI -VMHost $vmhost -V2
$esxcli.hardware.pci.list.Invoke() | Where-Object { $_.VMkernelName -match 'vmhba|vmnic|vmgfx' -and $_.ModuleName -ne 'None'}
Describe the bug
Running the new-asbuiltreport results in the following error:
new-asbuiltreport : Exception calling "Substring" with "1" argument(s): "startIndex cannot be larger than length of string.
Parameter name: startIndex"
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
To Reproduce
Steps to reproduce the behavior:
install-module PScribo
install-module asbuiltreport
Run the new-asbuiltreport with the example from the main github page:
PS C:\Windows\system32> new-asbuiltreport -report VMware.vSphere -username [email protected] -password -format html -OutputPath 'D:\As-built' -target <vcenter.fqdn>
Hi,
if i set my Cluster Info Level on a VCSA 7 running on pwsh 7.12 to higher then 2 i get this:
New-AsBuiltReport: You cannot call a method on a null-valued expression.
(After a Cluster Verbose-Line Like '... AdmissionControl ...', sry i did not captured it on my tests)
The vCenter (VCSA) has 'empty' Clusters configured (without Hosts), probably this is the reason i thought....
Best Regards
Describe the bug
In v1.0.6 of the VMware vSphere as-built report, the report's default font was modified to Century Gothic
font which would be a closer representation of the Metropolis font outlined in VMware's Clarity UX guidelines.
Century Gothic
was assumed to be a system font, however it appears that this font is not available on all Windows Operating Systems, resulting in occurrences of the report defaulting to the Times New Roman
font.
Workaround 1
Modify the font name in the default document style
get-module -ListAvailable -Name AsBuiltReport.VMware.vSphere | select modulebase
to identify the install location of the AsBuiltReport VMware vSphere moduleAsBuiltReport.VMware.vSphere.Style.ps1
-DefaultFont
to Arial
or another installed fontWorkaround 2
Specify a custom document style using the -StylePath
parameter
Resolution
This issue will be resolved in a future update.
Describe the bug
When running the vSphere As Built Report against some environments (not all), the script seems to run OK, but right at the end where the document should be generated, the script exits with the following error:
At line:14 char:1
+ New-AsBuiltReport @props
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
I have narrowed this down and it only occurs if the vCenter Server level is set to 3 or higher, and the specific section of code that is causing the problem is related to vSphere Tag Assignments:
$TagAssignments = Get-TagAssignment -Server $vCenter
if ($TagAssignments) {
Section -Style Heading3 'Tag Assignments' {
$TagAssignments | Sort-Object Tag, Entity | Table -Name 'Tag Assignments' -Columns Tag, Entity -ColumnWidths 50, 50
}
}
#endregion vCenter Server Tag Assignments
If the above section of code is removed or commented, the script will run with no issues at all.
In the environment I am running this against currently, there are two vCenter Servers running the same build (detailed below), but the script runs fine against one vCenter Server yet not the other.
In the problematic vSphere environment there are 138 tag assignments, in the environment that works OK there are 682 tag assignments.
To Reproduce
It doesn't seem to be clear on how to reproduce this issue at the moment. As described above I am running this in en environment that has two vCenter servers that, for the most part, seem to be based on the same build and are both using tag assignments, but the one with more tag assignments is OK and the one with fewer tag assignments is not ok.
Regardless, the steps to reproduce the behavior are:
The exact command being run (vCenter name obfuscated) is:
$props = @{
Report = "VMware.vSphere"
Target = "vcenter.domain.com"
Username = '[email protected]'
Password = 'SuperAwesomePassword'
Format = "html","word"
OutputPath = 'E:\vSphere 6.7 U3 Upgrade\Asbuilt'
StylePath = 'E:\vSphere 6.7 U3 Upgrade\Asbuilt\Parallo.ps1'
Timestamp = $true
ReportConfigPath = 'E:\vSphere 6.7 U3 Upgrade\Asbuilt\AsBuiltReport.VMware.vSphere.json'
AsBuiltConfigPath = 'E:\vSphere 6.7 U3 Upgrade\Asbuilt\AsBuiltReport.json'
}
New-AsBuiltReport @props
Expected behavior
The document should be produced with no errors.
Screenshots
If applicable, add screenshots to help explain your problem.
System (please provide the following information about the system from which you are trying to generate a report):
Additional context
If you dig in to some of the debugging in VS Code, the specific PScribo command it is failing on is Get-HtmlTable:
GetHtmlTable : Exception calling "IsNullOrEmpty" with "1" argument(s): "Server vsphere.local\[email protected]:443 is not connected."
At line:710 char:57
+ ... [ref] $null = $tableBuilder.Append((GetHtmlTable -Table $Table));
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [GetHtmlTable], MethodInvocationException
+ FullyQualifiedErrorId : ViServerConnectionException,GetHtmlTable
The report runs ok if you output to text instead of word or HTML.
Report works fine on one 6.5 vcenter, but not the 6.5 or other 6.7's
To Reproduce
Steps to reproduce the behavior:
New-AsBuiltReport -Report VMware.vSphere -Target 123.456.789 -Username vcheck -Password password -Format HTML,Word -OutputPath 'd:\Reports'
Expected behavior
Report should run with no errors.
Screenshots
VERBOSE: [ 14:13:43:903 ] [ Document ] - Processing section 'Historical Statistics' completed.
VERBOSE: [ 14:13:43:903 ] [ Document ] - Processing section 'Licensing' started.
VERBOSE: [ 14:13:43:950 ] [ Document ] - Processing table 'Licensing'.
New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
System (please provide the following information about the system from which you are trying to generate a report):
Major Minor Build Revision
5 1 14393 2969
Additional context
Had this issue on previous builds, thought Id try again on latest build but seem to have hit the same licence row isssue
Just started with the AsBuiltReports. I have all prereq's installed but when I attempt to run the vSphere module, I receive an error:
VERBOSE: [ 09:01:00:029 ] [ Document ] - Setting global document options.
VERBOSE: [ 09:01:00:029 ] [ Document ] - Enabling section/heading numbering.
VERBOSE: [ 09:01:00:030 ] [ Document ] - Setting default font(s) to 'Arial'.
VERBOSE: [ 09:01:00:030 ] [ Document ] - Setting page top margin to '25.05'mm.
VERBOSE: [ 09:01:00:031 ] [ Document ] - Setting page right margin to '25.05'mm.
VERBOSE: [ 09:01:00:031 ] [ Document ] - Setting page bottom margin to '25.05'mm.
VERBOSE: [ 09:01:00:031 ] [ Document ] - Setting page left margin to '25.05'mm.
VERBOSE: [ 09:01:00:031 ] [ Document ] - Setting page size to 'A4'.
VERBOSE: [ 09:01:00:032 ] [ Document ] - Setting page orientation to 'Portrait'.
VERBOSE: [ 09:01:00:032 ] [ Document ] - Setting page height to '297'mm.
VERBOSE: [ 09:01:00:033 ] [ Document ] - Setting page width to '210'mm.
VERBOSE: [ 09:01:00:033 ] [ Document ] - Setting document style 'Title'.
VERBOSE: [ 09:01:00:034 ] [ Document ] - Setting document style 'Title2'.
VERBOSE: [ 09:01:00:034 ] [ Document ] - Setting document style 'Title3'.
VERBOSE: [ 09:01:00:035 ] [ Document ] - Setting document style 'Heading1'.
VERBOSE: [ 09:01:00:035 ] [ Document ] - Setting document style 'Heading2'.
VERBOSE: [ 09:01:00:036 ] [ Document ] - Setting document style 'Heading3'.
VERBOSE: [ 09:01:00:036 ] [ Document ] - Setting document style 'Heading4'.
VERBOSE: [ 09:01:00:037 ] [ Document ] - Setting document style 'Heading5'.
VERBOSE: [ 09:01:00:037 ] [ Document ] - Setting document style 'Normal'.
VERBOSE: [ 09:01:00:038 ] [ Document ] - Setting document style 'Caption'.
VERBOSE: [ 09:01:00:038 ] [ Document ] - Setting document style 'Header'.
VERBOSE: [ 09:01:00:039 ] [ Document ] - Setting document style 'Footer'.
VERBOSE: [ 09:01:00:039 ] [ Document ] - Setting document style 'TOC'.
VERBOSE: [ 09:01:00:040 ] [ Document ] - Setting document style 'TableDefaultHeading'.
VERBOSE: [ 09:01:00:041 ] [ Document ] - Setting document style 'TableDefaultRow'.
VERBOSE: [ 09:01:00:041 ] [ Document ] - Setting document style 'Critical'.
VERBOSE: [ 09:01:00:042 ] [ Document ] - Setting document style 'Warning'.
VERBOSE: [ 09:01:00:042 ] [ Document ] - Setting document style 'Info'.
VERBOSE: [ 09:01:00:043 ] [ Document ] - Setting document style 'OK'.
VERBOSE: [ 09:01:00:043 ] [ Document ] - Setting table style 'TableDefault'.
VERBOSE: [ 09:01:00:044 ] [ Document ] - Setting table style 'Borderless'.
VERBOSE: [ 09:01:00:045 ] [ Document ] - Processing document header started.
VERBOSE: [ 09:01:00:046 ] [ Document ] - Processing paragraph 'VMware vSphere As Built Report - v1.0'.
VERBOSE: [ 09:01:00:050 ] [ Document ] - Processing document header completed.
VERBOSE: [ 09:01:00:050 ] [ Document ] - Processing document footer started.
VERBOSE: [ 09:01:00:051 ] [ Document ] - Processing paragraph 'Page <!# PageNumber #!>'.
VERBOSE: [ 09:01:00:052 ] [ Document ] - Processing document footer completed.
VERBOSE: [ 09:01:00:052 ] [ Document ] - Processing blank line.
VERBOSE: [ 09:01:00:053 ] [ Document ] - Processing image 'VMware Logo'.
VERBOSE: [ 09:01:00:064 ] [ Document ] - Processing blank line.
VERBOSE: [ 09:01:00:065 ] [ Document ] - Processing paragraph 'VMware vSphere As Built Report'.
VERBOSE: [ 09:01:00:068 ] [ Document ] - Processing blank line.
VERBOSE: [ 09:01:00:069 ] [ Document ] - Processing table 'Cover Page'.
VERBOSE: [ 09:01:00:070 ] [ Document ] - Processing page break.
VERBOSE: [ 09:01:00:070 ] [ Document ] - Processing table of contents 'Table of Contents'.
VERBOSE: [ 09:01:00:070 ] [ Document ] - Processing page break.
VERBOSE: [ 09:01:00:097 ] [ Document ] - Connecting to vCenter Server 'vcenter'.
VERBOSE: [ 09:01:00:751 ] [ Document ] - Checking vCenter user privileges.
VERBOSE: [ 09:01:00:885 ] [ Document ] - Creating VM lookup hashtable.
VERBOSE: [ 09:01:02:406 ] [ Document ] - Creating VMHost lookup hashtable.
VERBOSE: [ 09:01:02:503 ] [ Document ] - Creating Datastore lookup hashtable.
VERBOSE: [ 09:01:02:542 ] [ Document ] - Creating VDPortGroup lookup hashtable.
VERBOSE: [ 09:01:02:579 ] [ Document ] - Creating EVC lookup hashtable.
VERBOSE: [ 09:01:02:743 ] [ Document ] - Checking for VMware Update Manager Server.
VERBOSE: [ 09:01:02:745 ] [ Document ] - Checking for VxRail Manager Server.
VERBOSE: [ 09:01:02:745 ] [ Document ] - Checking for VMware Site Recovery Manager Server.
VERBOSE: [ 09:01:02:746 ] [ Document ] - Checking for VMware NSX-T Manager Server.
VERBOSE: [ 09:01:05:097 ] [ Document ] - Collecting vcenter advanced settings.
VERBOSE: [ 09:01:05:197 ] [ Document ] - Processing section 'vcenter' started.
VERBOSE: [ 09:01:05:198 ] [ Document ] - vCenter InfoLevel set at 3.
VERBOSE: [ 09:01:05:198 ] [ Document ] - Processing section 'vCenter Server' started.
VERBOSE: [ 09:01:05:199 ] [ Document ] - Processing paragraph 'The following sections detail the co[..]'.
VERBOSE: [ 09:01:05:199 ] [ Document ] - Processing blank line.
New-AsBuiltReport: Exception calling "Substring" with "1" argument(s): "startIndex cannot be larger than length of string. (Parameter 'startIndex')"
I am unsure of what is supposed to run at this point, so not sure where to look for an error.
Thank you for any help!
Describe the bug
The AsBuiltReport script fails to scan the hardware as well as trying to get to the ESXCLI of the HCX Dummy Host.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Perhaps the script could recognize the HCX host and skip any further operations.
Screenshots
VERBOSE: [ 11:00:48:742 ] [ Document ] - Processing blank line.
Get-EsxCli : 5/7/2019 11:00:50 AM Get-EsxCli Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.0.0\Src\Public\Invoke-AsBuiltReport.VMware.vSphere.ps1:1602 char:55
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-VMHostHardware : 5/7/2019 11:00:51 AM Get-VMHostHardware The operation is not supported on the object.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.0.0\Src\Public\Invoke-AsBuiltReport.VMware.vSphere.ps1:1603 char:63
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VERBOSE: [ 11:00:51:474 ] [ Document ] - Processing table '10.109.8.41 ESXi Host Detailed Information'.
VERBOSE: [ 11:00:51:548 ] [ Document ] - Processing section 'Boot Device' started.
Get-EsxCli : 5/7/2019 11:00:51 AM Get-EsxCli Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.0.0\Src\Public\Invoke-AsBuiltReport.VMware.vSphere.ps1:285 char:19
$esxcli = Get-EsxCli -V2 -VMHost $vmhost -Server $vCenter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New-AsBuiltReport : You cannot call a method on a null-valued expression.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
System (please provide the following information about the system from which you are trying to generate a report):
Is your feature request related to a problem? Please describe.
Provide the ability to generate a vSphere as-built report for specific named clusters within an environment.
Describe the solution you'd like
Provide the ability for users to provide cluster names within the report JSON configuration file to filter results of the generated report.
"Filter": {
"Cluster": ["Prod-Cluster","Dev-Cluster","QA-Cluster"]
}
Describe alternatives you've considered
No other alternatives have been considered at this point.
Additional context
Reports will contain information only related to the specified cluster names.
Describe the bug
A clear and concise description of what the bug is.
When the script is running, suddenly after some time a message that say appear:
New-AsBuiltReport : The underlying connection was closed: A connection that was expected to be kept alive
was closed by the server.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
That the DOc document were generated.
Screenshots
If applicable, add screenshots to help explain your problem.
System (please provide the following information about the system from which you are trying to generate a report):
3rd party PowerShell module name and version [e.g. VMware PowerCLI 11.2]
AsBuiltReport Core module version [e.g. 1.0.0]
AsBuiltReport Report module name and version [e.g. AsBuiltReport.VMware.vSphere 1.0.0]
Additional context
vCenter versioon 6.5
user with admin privileges on domain ([email protected])
I have to run this amazing tool with several vCenters and only in 1 on those had those problems. it has 4300 vms and 250 hosts
When using the Cluster filtering option some tables in the "Datastore Cluster => SDRS VM Overrides" section are returned empty.
vSphere Clusters:
PS /home/rebelinux> Get-Cluster
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
Level
---- --------- ---------- ---------- ------------------
RegionHQ-MGMT False 1 True FullyAutomated
RegionA01-COMP True 1 True FullyAutomated
PS /home/rebelinux>
Cluster Filter:
"Filter": {
"Cluster": ["RegionA01-COMP"]
},
Datastore Cluster from RegionA01-COMP Cluster:
Datastore Cluster from RegionHQ-MGMT Cluster:
I believe the Datastore Cluster need to be filtered by "Cluster": ["RegionA01-COMP"]
vCenter Resource Summary and vCenter Object Summary section are only displayed with $InfoLevel.vCenter -eq 2
I believe it would be beneficial to add these two sections in $InfoLevel.vCenter -ge 2
"vCenter": 2:
"vCenter": 3:
Describe the bug
When reporting against a VMware vSphere environment which contains an empty datastore cluster, the script terminates with a Attempted to divide by zero
error.
Describe the bug
In our environment we have Certificates Signed by our PKI in place but the report shows the default VMware certificate
To Reproduce
Running a VMware vSphere as built report against a VMware.vSphere
vCenter InfoLevel is 3 or higher
Host InfoLevel is 2 or higher
Cluster InfoLevel is 3 or higher
Describe the bug
A clear and concise description of what the bug is.
VERBOSE: [ 19:59:33:522 ] [ Document ] - Processing section 'Hardware' started.
VERBOSE: [ 19:59:33:538 ] [ Document ] - Processing paragraph 'The following section details the ho[..]'.
VERBOSE: [ 19:59:33:538 ] [ Document ] - Processing blank line.
VERBOSE: [ 19:59:34:572 ] [ Document ] - Processing table 'xxxx ESXi Host Detailed
Information'.
VERBOSE: [ 19:59:34:603 ] [ Document ] - Processing section 'Boot Device' started.
New-AsBuiltReport : Cannot convert value "N/A" to type "System.Int32". Error: "Input string was not in a correct
format."
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
The latest version 1.1.3. (AsBuiltReport) and latest PowerCLI version.
Boot Device from the server "None" --> Stateless Auto Deploay
Describe the bug
Running the command
New-AsBuiltReport -Report VMware.vSphere -Target vCenterFQDN -Credential (Get-Credential) -Format HTML,Word -OutputPath 'C:\Master\VMware\AsBuiltReport\Reports' -TimeStamp -EnableHealthcheck
Expected behavior
Not running in a Error or smooth go trough
System (please provide the following information about the system from which you are trying to generate a report):
$PSVersionTable.PSVersion
]Additional context
Is your feature request related to a problem? Please describe.
I would like to see all of the 'certmgmt' settings in the vSphere report please.
Describe the solution you'd like
Amend the vCenter Server SSL Certificate region to include:
vpxd.certmgmt.mode
vpxd.certmgmt.certs.hardThreshold
vpxd.certmgmt.certs.minutesBefore
vpxd.certmgmt.certs.pollIntervalDays
vpxd.certmgmt.certs.softThreshold
#region vCenter Server SSL Certificate
Section -Style Heading3 'SSL Certificate' {
$VcSslCertHash = @{
Country = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.cn.country'}).Value
Email = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.cn.email'}).Value
Locality = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.cn.localityName'}).Value
State = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.cn.state'}).Value
Organization = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.cn.organizationName'}).Value
OrganizationUnit = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.cn.organizationalUnitName'}).Value
DaysValid = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.daysValid'}).Value
Mode = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.mode'}).Value
HardThreshold = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.hardThreshold'}).Value
MinutesBefore = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.minutesBefore'}).Value
PollInterval = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.pollIntervalDays'}).Value
SoftThreshold = ($VCAdvSettings | Where-Object {$_.name -eq 'vpxd.certmgmt.certs.softThreshold'}).Value
}
$VcSslCertificate = $VcSslCertHash | Select-Object @{L = 'Country'; E = {$_.Country}}, @{L = 'State'; E = {$_.State}}, @{L = 'Locality'; E = {$_.Locality}},
@{L = 'Organization'; E = {$_.Organization}}, @{L = 'Organizational Unit'; E = {$_.OrganizationUnit}}, @{L = 'Email'; E = {$_.Email}}, @{L = 'Validity'; E = {"$($_.DaysValid / 365) Years"}},
@{L = 'Mode'; E = {$_.Mode}}, @{L = 'Hard Threshold'; E = {"$($_.HardThreshold) Days"}}, @{L = 'Soft Threshold'; E = {"$($_.SoftThreshold) Days"}},
@{L = 'Poll Interval'; E = {"$($_.PollInterval) Days"}}, @{L = 'Minutes Before'; E = {$($_.MinutesBefore)}}
$VcSslCertificate | Table -Name "$vCenter SSL Certificate" -List -ColumnWidths 50, 50
}
#endregion vCenter Server SSL Certificate
Describe alternatives you've considered
N/A
Describe the bug
When generating a report for a VMware vSphere 6.0 environment, the script terminates when collecting information about the VMHosts.
Other errors are observed with ESXCLI and VUM
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A vSphere report should be generated without any reported errors
When try to use AsBuiltReport on PowerShell Core, there is error about missing some VMware.PowerCLI cmdlets ( Get-VMHostHardware, Get-PatchBaseline, Get-Compliance)
it will be better to "skip" (and don't have an fatal error)
Now PScribo is compatible with PowerShell Core
**System
add diff of missing element if you "ignore" (See https://github.com/alagoutte/AsBuiltReport.VMware.vSphere/tree/Add-PowerShellCore-Support ) missing cmdlet
< 1.4.1.2.3 Update Manager Compliance
127d125
329,330d324
< 1.9 VMware Update Manager
< 1.9.1 Baselines
715c709
< Number of NICs : 2
---
> Number of NICs : Unknown
729c723
< Uptime Days : 30,11
---
> Uptime Days : 30,03
797,805d790
< 1.4.1.2.3 Update Manager Compliance
< ------------------------------------------------------------------------------------------------------------------------
<
< Baseline Status
< -------- ------
< Critical Host Patches (Predefined) Unknown
< Non-Critical Host Patches (Predefined) Unknown
<
<
1100,1101c1085,1086
< Serial Number : CZ3502LSAT
< Asset Tag :
---
> Serial Number : Unknown
> Asset Tag : Unknown
1110c1095
< Number of NICs : 2
---
> Number of NICs : Unknown
1185,1193d1169
< 1.4.2.2.3 Update Manager Compliance
< ------------------------------------------------------------------------------------------------------------------------
<
< Baseline Status
< -------- ------
< Critical Host Patches (Predefined) Unknown
< Non-Critical Host Patches (Predefined) Unknown
<
<
3638,3653d3595
<
<
< 1.9 VMware Update Manager
< ------------------------------------------------------------------------------------------------------------------------
< The following sections detail the configuration of VMware Update Manager managed by vCenter Server bdx-sr-vcsa.demovsan.
< intra.
<
< 1.9.1 Baselines
< ------------------------------------------------------------------------------------------------------------------------
<
< Baseline Description
< -------- -----------
< Critical Host Patches (Predefined) A predefined baseline for all critical patches for Hosts
< ESX Agent Manager :: 0cf991bd-bc58-4935-9419-34433eaf5e9e Baseline for agency: 0cf991bd-bc58-4935-9419-34433eaf5e9e and
< software: [334, 335, 336]owned by ESX Agent Manager
< Non-Critical Host Patches (Predefined) A predefined baseline for all non-critical patches for Hosts
Sirs,
I'm new to AsBuilt. Installed module for vsphere. I'm running esxi 6.5 and powershell version 5.1. Each time I attempt to run one of the example reports it stops at the same point. See error below. What am I missing?
New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection.
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
Since TPM should now be implemented for all deployments, can this detail be added to the report?
Link with example code:
https://vm.knutsson.it/2021/07/powercli-tpm-encryption-recovery-key-backup/
I got bitten by this after a recent deployment where the keys were not recorded and a node failed a couple of weeks after. Recovery would have been possible and faster had i recorded all the keys.
Describe the bug
When attempting to generate an as-built against a VMware on Cloud solution, such as VMware Cloud on AWS (VMC), Azure VMware Solution or Google VMware Engine, errors are generated or the report fails to generate.
This issue is due to restricted user permissions assigned to the default cloud administrator role [cloudadmin (VMC, AVS), cloudowner (GVE)] within these VMware on Cloud solutions.
To Reproduce
Running a VMware vSphere as built report against a VMware on Cloud solution using the default admin role will cause errors due to restricted user privileges.
These errors have been observed when;
Workarounds
Implement the following to produce an as-built for a VMware on Cloud environment.
Within the VMware vSphere report configuration file AsBuiltReport.VMware.vSphere.json
;
Expected behavior
The required user privileges to generate a VMware vSphere report are not provided with VMware on Cloud solutions.
The default user privileges for these VMware on Cloud solutions are defined as follows;
VMware Cloud on AWS
Azure VMware Solution
Google VMware Engine
Additional context
We will attempt to address and resolve these issues in a future release.
Setting InfoLevel greater than 2 for some classes produces fatal errors. Detail for each scenario in screenshots section below.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Produce the required output files.
Screenshots
"InfoLevel": {
"_comment_": "0 = Disabled, 1 = Summary, 2 = Informative, 3 = Detailed, 4 = Adv Detailed, 5 = Comprehensive",
"vCenter": 2,
"Cluster": 3,
"ResourcePool": 3,
"VMHost": 2,
"Network": 3,
"vSAN": 0,
"Datastore": 3,
"DSCluster": 3,
"VM": 2,
"VUM": 3
},
This completes as expected and produces HTML and Text output defined with -Format HTML,Text parameters.
Setting vCenter to InfoLevel 3:
PS C:\PS-scripts> C:\PS-scripts\Reporting\vCenter\AsBuiltReports\New-Asbuilt_Report-DC1.ps1
New-AsBuiltReport : You cannot call a method on a null-valued expression.
At C:\PS-scripts\Reporting\vCenter\AsBuiltReports\New-Asbuilt_Report-DC1.ps1:4 char:1
+ New-AsBuiltReport -Report VMware.vSphere -Target $creds.Host -Timesta ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
Setting VMHost to InfoLevel 3:
PS C:\PS-scripts> C:\PS-scripts\Reporting\vCenter\AsBuiltReports\New-Asbuilt_Report-DC1.ps1
Get-VMHostHardware : 8/28/2020 9:28:24 AM Get-VMHostHardware Permission to perform this operation was denied.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.1.3\Src\Public\Invoke-AsBuiltReport.VMware.vSphere.ps1:1793 char:63
+ ... $VMHostHardware = Get-VMHostHardware -VMHost $VMHost
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-VMHostHardware], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostHardware
New-AsBuiltReport : Permission to perform this operation was denied.
At C:\PS-scripts\Reporting\vCenter\AsBuiltReports\New-Asbuilt_Report-DC1.ps1:4 char:1
+ New-AsBuiltReport -Report VMware.vSphere -Target $creds.Host -Timesta ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
Setting VM to InfoLevel 3:
PS C:\PS-scripts> C:\PS-scripts\Reporting\vCenter\AsBuiltReports\New-Asbuilt_Report-DC1.ps1
Get-SpbmEntityConfiguration : 8/28/2020 9:33:03 AM Get-SpbmEntityConfiguration Permission to perform this operation was denied. Required privilege 'StorageProfile.View' on managed object
with id 'Folder-group-d1'.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.1.3\Src\Public\Invoke-AsBuiltReport.VMware.vSphere.ps1:3639 char:49
+ ... $VMSpbmConfig = Get-SpbmEntityConfiguration -VM ($VMs) | Where ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SpbmEntityConfiguration], NoPermission
+ FullyQualifiedErrorId : Storage_SpbmProfileServiceImpl_GetAssociatedStoragePolicy_ViError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetSpbmEntityConfiguration
Hangs here until CTRL+C
System (please provide the following information about the system from which you are trying to generate a report):
PS C:\> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 1007
Version Name Repository Description
------- ---- ---------- -----------
1.0.5 AsBuiltReport PSGallery A PowerShell module manifest which ins...
0.2.1 AsBuiltReport.Cisco.UcsManager PSGallery A PowerShell module to generate an as ...
1.0.5 AsBuiltReport.Core PSGallery A PowerShell module which provides the...
1.1.0 AsBuiltReport.Nutanix.PrismElement PSGallery A PowerShell module to generate an as ...
0.4.1 AsBuiltReport.PureStorage.FlashA... PSGallery A PowerShell module to generate an as ...
0.0.7 AsBuiltReport.Rubrik.CDM PSGallery A PowerShell module to generate an as ...
1.0.0 AsBuiltReport.VMware.ESXi PSGallery A PowerShell module to generate an as ...
0.4.1 AsBuiltReport.VMware.NSXv PSGallery A PowerShell module to generate as bui...
1.1.3 AsBuiltReport.VMware.vSphere PSGallery A PowerShell module to generate an as ...
3.0.0.10 Cisco.UCS.Common PSGallery PowerShell Module for Cisco Core (Core...
2.5.3.0 Cisco.UCS.Core PSGallery PowerShell Module for Cisco Core (Core...
3.0.0.10 Cisco.UCSManager PSGallery PowerShell Module for Cisco UCS Manage...
1.4.7 PackageManagement PSGallery PackageManagement (a.k.a. OneGet) is a...
2.2.4.1 PowerShellGet PSGallery PowerShell module with commands for di...
0.9.1 PScribo PSGallery PScribo documentation Powershell modul...
1.17.3.0 PureStoragePowerShellSDK PSGallery Pure Storage FlashArray REST API integ...
12.0.0.15947289 VMware.CloudServices PSGallery PowerCLI CloudServices sample module.
7.0.0.15902843 VMware.DeployAutomation PSGallery This Windows PowerShell module contain...
7.0.0.15902843 VMware.ImageBuilder PSGallery This Windows PowerShell module contain...
12.0.0.15947286 VMware.PowerCLI PSGallery This Windows PowerShell module contain...
7.0.0.15939650 VMware.Vim PSGallery This Windows PowerShell module contain...
12.0.0.15939657 VMware.VimAutomation.Cis.Core PSGallery This Windows PowerShell module contain...
12.0.0.15940183 VMware.VimAutomation.Cloud PSGallery This Windows PowerShell module contain...
12.0.0.15939652 VMware.VimAutomation.Common PSGallery This Windows PowerShell module contain...
12.0.0.15939655 VMware.VimAutomation.Core PSGallery This Windows PowerShell module contain...
12.0.0.15939647 VMware.VimAutomation.Hcx PSGallery This Windows PowerShell module contain...
7.12.0.15718406 VMware.VimAutomation.HorizonView PSGallery This Windows PowerShell module contain...
12.0.0.15939670 VMware.VimAutomation.License PSGallery This Windows PowerShell module contain...
12.0.0.15939671 VMware.VimAutomation.Nsxt PSGallery This Windows PowerShell module contain...
12.0.0.15939651 VMware.VimAutomation.Sdk PSGallery This Windows PowerShell module contain...
12.0.0.15939672 VMware.VimAutomation.Security PSGallery This Windows PowerShell module contain...
11.5.0.14899557 VMware.VimAutomation.Srm PSGallery This Windows PowerShell module contain...
12.0.0.15939648 VMware.VimAutomation.Storage PSGallery This Windows PowerShell module contain...
1.3.0.0 VMware.VimAutomation.StorageUtility PSGallery This Windows PowerShell module contain...
12.0.0.15940185 VMware.VimAutomation.Vds PSGallery This Windows PowerShell module contain...
12.0.0.15947287 VMware.VimAutomation.Vmc PSGallery This Windows PowerShell module contain...
12.0.0.15940184 VMware.VimAutomation.vROps PSGallery This Windows PowerShell module contain...
12.0.0.15947288 VMware.VimAutomation.WorkloadMan... PSGallery PowerShell commands for automation of ...
6.5.1.7862888 VMware.VumAutomation PSGallery This Windows PowerShell module contain...
Additional context
[email protected] was used for each New-AsBuiltReport to avoid any rights errors.
Describe the bug
New-AsBuiltReport: Message: EsxCLI.CLIFault.summary;
InnerText: [InstallationError] Failed to initiate installer: Could not parse Vib xml from database /var/db/esximg: ('Unknown', 'Could not parse VIB XML data: None (line 0).') cause = Could not parse Vib xml from database /var/db/esximg: ('Unknown', 'Could not parse VIB XML data: None (line 0).') Please refer to the log file for more details.EsxCLI.CLIFault.summary
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
If applicable, add screenshots to help explain your problem.
System (please provide the following information about the system from which you are trying to generate a report):
Additional context
Add any other context about the problem here.
Describe the bug
Script terminates with the following error when trying to retrieve PCIe device information
New-AsBuiltReport : Message: EsxCLI.CLIFault.summary;
InnerText: There is no pnic with name vmnic2EsxCLI.CLIFault.summary
At line:1 char:1
+ New-AsBuiltReport -Report VMware.vSphere -Target vcenter.domain.local ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
To Reproduce
When connecting to vCenter with PowerCLI and running the Get-PciDeviceDetail
function manually, the following information and errors are displayed
VMkernel Name : vmhba0
Device Name : Smart Array P220i
Driver : nhpsa
Driver Version : 2.0.24-1OEM.650.0.0.4598673
Firmware Version : N/A
VIB Name : nhpsa
VIB Version : 2.0.24-1OEM.650.0.0.4598673
VMkernel Name : vmnic0
Device Name : QLogic 57810 10 Gigabit Ethernet Adapter
Driver : bnx2x
Driver Version : Version 2.713.30.v60.9, Build: 2494585, Interface: 9.2 Built on: Sep 20 2017
Firmware Version : bc 7.13.75
VIB Name : net-bnx2x
VIB Version : 2.713.30.v60.9-1OEM.600.0.0.2494585
VMkernel Name : vmnic1
Device Name : QLogic 57810 10 Gigabit Ethernet Adapter
Driver : bnx2x
Driver Version : Version 2.713.30.v60.9, Build: 2494585, Interface: 9.2 Built on: Sep 20 2017
Firmware Version : bc 7.13.75
VIB Name : net-bnx2x
VIB Version : 2.713.30.v60.9-1OEM.600.0.0.2494585
Message: EsxCLI.CLIFault.summary;
InnerText: There is no pnic with name vmnic2EsxCLI.CLIFault.summary
At line:47 char:21
+ ... $vmnicDetail = $esxcli.network.nic.get.Invoke(@{nicname = ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], MethodFault
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault
VMkernel Name : vmnic2
Device Name : QLogic 57810 10 Gigabit Ethernet Adapter
Driver : bnx2x
Driver Version : Version 2.713.30.v60.9, Build: 2494585, Interface: 9.2 Built on: Sep 20 2017
Firmware Version : bc 7.13.75
VIB Name : net-bnx2x
VIB Version : 2.713.30.v60.9-1OEM.600.0.0.2494585
Message: EsxCLI.CLIFault.summary;
InnerText: There is no pnic with name vmnic3EsxCLI.CLIFault.summary
At line:47 char:21
+ ... $vmnicDetail = $esxcli.network.nic.get.Invoke(@{nicname = ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], MethodFault
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault
VMkernel Name : vmnic3
Device Name : QLogic 57810 10 Gigabit Ethernet Adapter
Driver : bnx2x
Driver Version : Version 2.713.30.v60.9, Build: 2494585, Interface: 9.2 Built on: Sep 20 2017
Firmware Version : bc 7.13.75
VIB Name : net-bnx2x
VIB Version : 2.713.30.v60.9-1OEM.600.0.0.2494585
VMkernel Name : vmnic4
Device Name : QLogic 57810 10 Gigabit Ethernet Adapter
Driver : bnx2x
Driver Version : Version 2.713.30.v60.9, Build: 2494585, Interface: 9.2 Built on: Sep 20 2017
Firmware Version : bc 7.13.75
VIB Name : net-bnx2x
VIB Version : 2.713.30.v60.9-1OEM.600.0.0.2494585
VMkernel Name : vmnic5
Device Name : QLogic 57810 10 Gigabit Ethernet Adapter
Driver : bnx2x
Driver Version : Version 2.713.30.v60.9, Build: 2494585, Interface: 9.2 Built on: Sep 20 2017
Firmware Version : bc 7.13.75
VIB Name : net-bnx2x
VIB Version : 2.713.30.v60.9-1OEM.600.0.0.2494585
Expected behavior
PCIe device information should be retrieved successfully from all hosts which are in a connected state
Hi!
As to see in this output, I believe the VM-Names should be [regex]::escape()'ed before used as Parameter for Get-View.
Regards
Please wait while the VMware vSphere As Built Report is being generated.
Get-View : 2/17/2021 5:10:34 AM Get-View Invalid pattern '^IP-100 [LastWrite=2017-07-20_08:44:54]$' at offset 25. [x-y] range in reverse order.
At C:\Users\***\Documents\PowerShell\Modules\AsBuiltReport.VMware.vSphere\1.2.1\Src\Private\Get-Uptime.ps1:18 char:25
+ … imeObject = Get-View -ViewType VirtualMachine -Property Name, Runtime …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 2/17/2021 5:11:01 AM Get-View Invalid pattern '^MitterDev [LastWrite=2017-01-16_10:04:10]$' at offset 28. [x-y] range in reverse order.
At C:\Users\***\Documents\PowerShell\Modules\AsBuiltReport.VMware.vSphere\1.2.1\Src\Private\Get-Uptime.ps1:18 char:25
+ … imeObject = Get-View -ViewType VirtualMachine -Property Name, Runtime …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 2/17/2021 5:11:37 AM Get-View Invalid pattern '^SCCCL12 [LastWrite=2020-04-08_08:12:11]$' at offset 29. [x-y] range in reverse order.
At C:\Users\***\Documents\PowerShell\Modules\AsBuiltReport.VMware.vSphere\1.2.1\Src\Private\Get-Uptime.ps1:18 char:25
+ … imeObject = Get-View -ViewType VirtualMachine -Property Name, Runtime …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 2/17/2021 5:11:48 AM Get-View Invalid pattern '^SCCCL49 - Win8.1 - WinCCV7.3 [LastWrite=2018-08-17_14:12:32]$' at offset 47. [x-y] range in reverse order.
At C:\Users\***\Documents\PowerShell\Modules\AsBuiltReport.VMware.vSphere\1.2.1\Src\Private\Get-Uptime.ps1:18 char:25
+ … imeObject = Get-View -ViewType VirtualMachine -Property Name, Runtime …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
VMware vSphere As Built Report '2021-02-17_05-07-32_vSphereAbrInventory' has been saved to '\\xxxx'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.