VMware Cloud Community
AlbertWT
Virtuoso
Virtuoso

Resetting the global:DefaultVIServer and global:DefaultVIServers system variables ?

Hi,

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

Any help would be greatly appreciated.

Thanks

/* Please feel free to provide any comments or input you may have. */
0 Kudos
5 Replies
AlbertWT
Virtuoso
Virtuoso

The symptoms is that 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
/* Please feel free to provide any comments or input you may have. */
0 Kudos
mattboren
Expert
Expert

Hello, AlbertWT-

It looks like you might be using some PowerGUI (based on that temp PS1 filename), not just a straight PowerShell session with the PowerCLI PSSnapin(s) loaded -- is that the case?  If so, there have been reports of uninstalling/reinstalling PowerGUI to work around the issue, that something in the PowerGUI configs is mucked up.

If you are using PowerGUI, can you give the uninstall/reinstall a try?

AlbertWT
Virtuoso
Virtuoso

Yes I'm using the latest version of PowerGUI v3.6.0.8

/* Please feel free to provide any comments or input you may have. */
0 Kudos
mattboren
Expert
Expert

Alright -- and, did you try an uninstall and reinstall of PowerGUI to see what effect that has on your situation?  If not, how about you give it a try?  If so, did it have any effect?

0 Kudos
AlbertWT
Virtuoso
Virtuoso

Hi,

I have uninstall and then reinstall the PowerGUI IDE again for the second time, but still the issue persisted.

Get-Variable cmdlets doesn't return anything with those two variables. global:DefaultVIServer and global:DefaultVIServers

/* Please feel free to provide any comments or input you may have. */
0 Kudos