Hi All,
Trying to run the following command. but I'm not connecting to NSX Manager:
PS C:>New-AsBuiltReport -Report VMware.NSXv -Target vc01 -Credential (Get-Credential) -Format HTML,Word -OutputPath C:\Scripts
Using existing PowerCLI connection to VCenterXX
Error
Invoke-AsBuiltReport.VMware.NSXv : Connection to NSX server 172.X.X.X failed : Invoke-NsxRestMethod : The NSX API
response received indicates a failure. 503 : Service Unavailable : Response Body:
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Core\1.0.1\Src\Public\New-AsBuiltReport.ps1:307 char:13
& "Invoke-$($ReportModule)" -Target $Target -Credential $ ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VERBOSE: [ 12:41:55:219 ] [ Document ] - Document 'VMware NSXv As Built Report' processing completed.
VERBOSE: [ 12:41:55:221 ] [ Document ] - Total processing time '59.93' seconds.
VMware NSXv As Built Report has been saved to c:\temp
I've tested the credentials not using PowerNSX and no issue. The account is Enterprise Administrator
After digging for a while it's finally working. My problem was powershell proxy settings
I changed the setting of the proxy configuration to ‘no proxy’ in PowerShell with the below command I was able to connect and run the script with no problems.
Set-PowerCliConfiguration -proxypolicy noproxy
Hello,
First of all, verify that you got all modules:
Open a Windows PowerShell terminal window and install each of the required modules as follows;
PS C:\> install-module PScribo
PS C:\> install-module VMware.PowerCLI
PS C:\> install-module PowerNSX
Then please try to do as follow:
1. Run PowerShell with Administrator Privilages
2. Run command: New-AsBuiltReport -Report VMware.NSXv -Target [vCenter IP] -Credential (Get-Credential) -Format HTML,Word -OutputPath C:\Scripts
3. Enter your vCenter credintionals, it would be best to use administrator@vsphere.local
Hi Marcin,
I've followed all the steps mentioned in your post and the problem persist. I get the same error message
Thanks
Hmm,
Are you able to do the report from vsphere, try the follow:
New-AsBuiltReport -Report VMware.vSphere -Target [vCenter IP] -Credential (Get-Credential) -Format HTML,Word -OutputPath 'C:\Scripts\' -TimeStamp -EnableHealthcheck
vSphere report works fine. No errors like the ones I see running 'VMware.NSXv':-(
Thanks
What is your NSX version?
Have you tried to reboot NSX Manger ?
After digging for a while it's finally working. My problem was powershell proxy settings
I changed the setting of the proxy configuration to ‘no proxy’ in PowerShell with the below command I was able to connect and run the script with no problems.
Set-PowerCliConfiguration -proxypolicy noproxy