Sunday, September 6, 2015

Connect-VIserver Could not connect using the requested protocol.

Today I wanted to build some critical script in my Lab. when I opened Powercli and tried to connect my vCenter I was receiving below error.
 ##################################################
Connect-VIServer :  6/08/2015 3:31:27 AM        Connect-VIserver          Could not connect using the requested protocol.
At line:1 char:1
+ Connect-VIServer itvc001.age.com
+
        + CategoryInfo               : ObjectNotFound: (:) [Connect-VIserver], ViServerConnectionException
        + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_ProtocolError, VMware.VimAutomation.ViCore.Cmd
    lets.Commands.ConnectVIServer
##################################################
In case you get below error, you can use same solution to resolve this issue.
The remote server returned an error: (407) Proxy Authentication Required

After many try on vmware KB I stumbled upon below KB and found the solution. This issue occurs due to the proxy settings in the environment.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2011395 
To resolve this, check the proxy settings using the PowerCLI and set the proxy to No Proxy.
To set the proxy setting to No Proxy:

 1.Run this command to find the current proxy settings:
    Get-PowerCLIConfiguration
    You see an output similar to:

    C:\PS>Get-PowerCLIConfiguration

   Proxy Policy Default            Server Mode
   -------------------------       ---------------
   UseSystemProxy                  Single


    Note: This output indicates that the PowerCLI is using the System Proxy.

 2.To change this setting, run this command:
    Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm
    You see an output similar to:

  C:\PS>Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm

    Perform operation?

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

  Proxy Policy Default       ServerMode
  ------------               ---------------
  NoProxy                    Single


Once above changes done I am able to login successfully.

No comments: