PowerCLI

  • 1.  I get a login prompt in connect-ViServer

    Posted Jan 20, 2025 02:25 AM
    In an environment using vcenter integrated security, I get a login prompt in connect-ViServer even though I am logged in as an authorized AD user. How can I prevent the prompt from appearing?
     
    $vi = Connect-VIServer -Server (FQDN)


  • 2.  RE: I get a login prompt in connect-ViServer

    Posted Jan 20, 2025 03:50 AM

    That could be a TLS or certificate issue.
    What do you see when you add a Verbose switch to the Connect-VIServer?

    Does it mention not being able to establish a secure channel?
    Try setting InvalidCertificateAction to Ignore with the Set-PowerCLIConfiguration cmdlet.
    Or better yet, make sure the certificate is installed and added to trusted root certificates. 



    ------------------------------


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


    ------------------------------



  • 3.  RE: I get a login prompt in connect-ViServer

    Posted Jan 21, 2025 02:43 AM

    Soory Japanese

    C:\Windows\system32> $vi = Connect-VIServer -Server xxx -Verbose
    詳細: Attempting to connect using SSPI
    詳細: メッセージを受信できる https://xxx/sdk
    でリッスンしているエンドポイントがありませんでした。これは一般に、アドレスまたは SOAP
    アクションが正しくない場合に発生します。詳細については、InnerException を参照してください (ある場合)。
    詳細: Connect using SSPI was unsuccessful
    Connect-VIServer : 2025/01/21 13:17:43  Connect-VIServer                Could not resolve the requested VC server.
    Additional Information: メッセージを受信できる https://xxx/sdk でリッスンしているエンドポイント
    がありませんでした。これは一般に、アドレスまたは SOAP アクションが正しくない場合に発生します。詳細については、InnerExce
    ption を参照してください (ある場合)。
    発生場所 行:1 文字:7
    + $vi = Connect-VIServer -Server xxx -Verbose
    +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (:) [Connect-VIServer], ViServerConnectionException
        + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_NameResolutionFailure,VMware.VimAutomation.Vi
       Core.Cmdlets.Commands.ConnectVIServer




  • 4.  RE: I get a login prompt in connect-ViServer

    Posted Jan 21, 2025 02:48 AM

    The error "Could not resolve the requested VC server " suggests a DNS issue.
    Or it could be a service on the VCSA that is not running.

    Also check if there is an incorrect VICredentialSToreItem entry with Get-VICredentialSToreItem



    ------------------------------


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


    ------------------------------