Monday, December 21, 2015

PowerCli - The remote server returned an error: (407) Proxy Authentication Required

Today one of my colleague had below issue while accessing Powercli, He was able to connect to vcenter, but after executing any command he was getting Proxy Authentication. 2 months back I had faced same issue Connect-VIserver Could not connect using the requested protocol. and same solution apply to this problem.
################################################################################
Get-VM : 12/21/2015 7:04:05 PM    Get-VM        The remote server returned an error: (407) Proxy Authentication
Required.
At line:1 char:1
+ Get-VM
+ ~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-VM], ViError
    + FullyQualifiedErrorId : Client20_QueryServiceImpl_RetrievePropertiesEx_ViError,VMware.VimAutomation.ViCore.Cmdle
   ts.Commands.GetVM

################################################################################

This is how I troubleshooted issue.
  1.  I executed command Get-VM,
  2. But received error -The remote server returned an error: (407) Proxy Authentication
  3. I checked my status whether i am connected to vcenter using $Global:DefaultVIServer.
  4. It was connected, Name is the IP address of my vCenter.
  5. Next I checked Get-PowerCLIConfiguration
  6. I found ProxyPolicy is set to UseSystemProxy for Session scope. and it is using my proxy to connect to vCenter.
  7. I change the proxy policy to NoProxy for Session Scope using Set-PowerCLIConfiguration -Scope Session -ProxyPolicy NoProxy
  8. Press Y to confirmation on changing settings
  9. Once the changes done, You will see changed result.
  10. This is the last one, I checked Get-VM and without any issue I got my results on the console.
Post a Comment