Can anyone here please assist me in resetting the global:DefaultVIServer and global:DefaultVIServers system variables into $null ?
because I cannot do anything with my PowerShell anymore even after reinstalling the PowerCLi and upgrading it into 5.1U2, here's the output of the version information and the configuration information:
Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeoutSeconds
----- ----------- ------------------- ------------------------ -------------------------- --------------------------
Session UseSystemProxy Multiple Unset True 300
User UseSystemProxy Multiple
AllUsers Single
WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running.'.
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.1 Release 2 build 1012425
---------------
Snapin Versions
---------------
VMWare AutoDeploy PowerCLI Component 5.1 build 768137
VMWare ImageBuilder PowerCLI Component 5.1 build 768137
VMware License PowerCLI Component 5.1 build 669840
VMware VDS PowerCLI Component 5.1 build 1012428
VMware vSphere PowerCLI Component 5.1 build 1012428
Due to this error, I cannot even issue a simple PowerCLi command to get the list of my VM, see the following error:
WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running.'.
Get-VM : You have modified the global:DefaultVIServer and global:DefaultVIServers system variables. This is not allowed. Please reset them to $null and reconnect to the vSphere server.
At C:\Users\Albert\AppData\Local\Temp\4a44b139-36b2-4045-bf3c-a51cff5472b4.ps1:1 char:7
+ Get-VM <<<<
+ CategoryInfo : NotSpecified: (:) [Get-VM], InvalidState
+ FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.InvalidState,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM
Any help would be greatly appreciated.
Thanks