VMware Cloud Community
_efman
Contributor
Contributor

Connect-VIServer doesnt work with new vCenter (8.0)

Hi All,

I tried to configure the well-known vCheck script to connect to my new v8.0 vCenter. At first I thought the error is located where the vcheck creates the credentials.xml file, so I tried to first connect to the vcenter manually. However i receive the following error. I tried with the admin account and with a read-only account. 

My vcenter has a functioning ssl certificate, as it should. Still I set the powercli configuration to ignore.

The exact same connect-viserver command works for the other vcenter that is v7.x

 

Connect-VIServer : 11.09.2023 09:25:59 Connect-VIServer The HTTP request was forbidden with client authentication scheme 'Anonymous'
At line:1 char:1
+ Connect-VIServer -Server "Server"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-VIServer], ViError
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_SoapException,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

Reply
0 Kudos
8 Replies
LucD
Leadership
Leadership

Looks like you have an invalid or missing certificate on the machine where you run Connect-VIServer.
You can bypass the error by ignoring this kind of error

Set-PowerCLIConfiguration -InvalidCertificateAction ignore


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
_efman
Contributor
Contributor

Hi LucD

Thanks for your reply, i profited a lot from your knowledge in my daily work!

I already set it as you wrote, here the Output

PS C:\Scripts\vCheck - vCenter> Set-PowerCLIConfiguration -InvalidCertificateAction ignore

Perform operation?
Performing operation 'Update VMware.PowerCLI configuration.'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A

Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout
Seconds
----- ----------- ------------------- ------------------------ -------------------------- -------------------
Session UseSystemProxy Multiple Ignore True 300
User Multiple Ignore
AllUsers


PS C:\Scripts\vCheck - vCenter>

Reply
0 Kudos
LucD
Leadership
Leadership

Did you do that for all Scopes?
And did you stop/start your PS/PowerCLI session after the change?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
_efman
Contributor
Contributor

Yes I did, it is still the same error message.

Does 8.0 have issues with this PS Version?

PS C:\Windows\system32> Get-PSVersion

Major Minor Build Revision
----- ----- ----- --------
5 1 14409 1027

Do I have to change something in 8.0 to make the PowerCLI connection work?

 

PowerCLI Version:

Script 8.1.0.2... VMware.Vim
Script 13.1.0.... VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService}
Script 13.1.0.... VMware.VimAutomation.Common {Get-PowerCLIContext, Get-Task, New-OAuthSecurityContext, Stop-Task...}
Script 13.1.0.... VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-V
Script 13.1.0.... VMware.VimAutomation.Sdk {Get-ErrorReport, EnableParameterCompleters, Get-InstallPath, Get-PSVersion}

Reply
0 Kudos
LucD
Leadership
Leadership

No, works perfectly for me with vSphere 8.*

I do notice that you are using a rather older PSv5.1 version.
Is that the original version that came with Windows 2012R2?

My current version is  5.1.19041.3031

Did you also try with PSv7?
They can be installed side-by-side on a Windows platform.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
_efman
Contributor
Contributor

I just tried to do it with Powershell 7.... However i am stuck with the problem those people here are dealing with: https://github.com/PowerShell/PowerShellGallery/issues/153

I cant get the module.

 

Reply
0 Kudos
LucD
Leadership
Leadership

Did you try the different diagnostics mentioned in that thread?
Did any of the bypasses work?

Are you running this on a Windows 2012R2 platform?
You do know that support for Windows 2012R2 will expire end of next month


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
_efman
Contributor
Contributor

I had no luck with the provided solutions. 

Now after doing  a fresh install on W2022 and installing Powershell 7 with the PowerCLI module it works, I can connect to my new vCenter. 

Thank you.

Reply
0 Kudos