vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
743 stars 602 forks source link

Connect-SSOAdminServer failed with some vCenter Servers #539

Open NikGK opened 2 years ago

NikGK commented 2 years ago

Describe the bug

I have installed several vCenter servers v7.0U3 with the same build. I 'm using the module (Import-Module ./VMware.vSphere.SsoAdmin.psd1) downloaded from your repisitory. I want to use the Connect-SsoAdminServer command but I notice the command is failed with certain vCenter Server and not with another ones.

I use the fqdn of vCenter Server as parameter server.

Connect-SsoAdminServer -Server 'fqdn of vic '

cmdlet Connect-SsoAdminServer at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) User: administrator@vsphere.local Password: ****

Here the message error Connect-SsoAdminServer : One or more errors occurred. At line:1 char:1

if I wan to go deeper in the error

$error[0] | select *

writeErrorStream : True PSMessageDetails : Exception : Microsoft.PowerShell.Commands.WriteErrorException: One or more errors occurred. TargetObject : CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Connect-SsoAdminServer ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace : at Connect-SsoAdminServer, C:\My Datas\NID\Training_Programssources\My Scripts Powershell\PowerCLI_Repo\Modules\VMware.vSphere.SsoAdmin\Connect.ps1: line 85 at , : line 1 PipelineIterationInfo : {0, 1}

Have you any ideas?

Reproduction steps

1. Import-Module ./VMware.vSphere.SsoAdmin.psd1
2. Connect-SsoAdminServer -Server FQDN-vCenter
3. Enter Username@vsphere.local ( here: administrator@vsphere.local )
4. Enter password
5. Get error ( see info above)
...

Expected behavior

I have to get this kind of message:

cmdlet Connect-SsoAdminServer at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) User: administrator@vsphere.local Password: ****

Name : FQDN-VIC ServiceUri : https://FQDN-VIC/sso-adminserver/sdk/vsphere.local User : administrator@vsphere.local Id : /SsoAdminServer=vsphere.local/administrator@FQDN-VIC IsConnected : True Client : VMware.vSphere.SsoAdminClient.SsoAdminClient RefCount : 1

Additional context

No response

dmilov commented 2 years ago

Hi, in case the deployment topology is one SSO for many VC servers then you have to specify the SSO Server (Management Node) address to the Connect-SsoAdminServer command.

wolficool commented 5 months ago

I have also these Error.. Any Suggestion or info how to Resolve that? I receive the following Error when i try to connect on many vCenter Servers.. (vCenter 7 and also 8)

Connect-SsoAdminServer : One or more errors occurred. At line:1 char:1

PS C:\Users\test> $error[0] | select *

writeErrorStream : True PSMessageDetails : Exception : Microsoft.PowerShell.Commands.WriteErrorException: One or more errors occurred. TargetObject : CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Connect-SsoAdminServer ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace : at Connect-SsoAdminServer, C:\Program Files\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\1.3.9\Connect.ps1: line 110 at , : line 1 PipelineIterationInfo : {0, 1}

kamennikolov commented 5 months ago

Can you run this script that will list the full error details:

$ErrorRecord = $error[0] $ErrorRecord | Format-List -Force $ErrorRecord.InvocationInfo |Format-List $Exception = $ErrorRecord.Exception for ($i = 0; $Exception; $i++, ($Exception = $Exception.InnerException)) { “$i” 80 $Exception |Format-List -Force }