5 Replies Latest reply on Jul 24, 2019 7:32 AM by LucD

    Cannot Connect to CIM Server

    DanTheMan42 Lurker

      CIMError.png

       

      CodeError.PNG

      Running this piece of code gives me the above error.

      Throughout my code I call Invoke-VMScript many times within the same code block and some of them work and some don't. All of them use the same credentials.

      I am running PowerCLI 11.3.0 and VMWare.Vim 6.7 if that helps at all.

       

      Does anyone know a solution to this error?

       

      Thanks,

       

      Daniel Steiger

        • 1. Re: Cannot Connect to CIM Server
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors

          I don't think this has anything to do with PowerCLI nor with the vSphere version.

          Looks like the Rename-NetAdapter cmdlet has a problem.


          Can you run the code in the guest OS itself from a PS prompt?

          Make sure to logon with the same account you used for the Invoke-VMScript cmdlet.

          • 2. Re: Cannot Connect to CIM Server
            DanTheMan42 Lurker

            I was able to run this command in the guest OS from PS with the same account.

            I was also receiving this error on other cmdlets besides Rename-NetAdapter.

             

            Thanks for the timely reply!

            • 3. Re: Cannot Connect to CIM Server
              LucD Guru
              Community WarriorsvExpertUser Moderators

              Anything in the eventlogs that gives more info on what the error might be?

              • 4. Re: Cannot Connect to CIM Server
                DanTheMan42 Lurker

                I looked in the PowerShell Event log with the Get-EventLog -LogName 'Windows PowerShell' cmdlet and also looked through the computer event log. Nothing stood out as being relevant to the problem I was having. There were no errors in the PowerShell log, only warnings that said the following:

                "The specified mount name 'vmstores' is already in use"

                "The specified mount name 'vis' is already in use"

                "Attempting to perform the NewDrive operation on the 'VimInventory' provider fail..."

                 

                The computer event log had no warnings or errors.

                 

                If neither of these is the right eventlog you were referring to, could you please be more specific?

                • 5. Re: Cannot Connect to CIM Server
                  LucD Guru
                  Community WarriorsUser ModeratorsvExpert

                  No specific eventlog intended, just in general.

                   

                  On another note, the messages that registry entries were marked for deletion.

                  Did you reboot the VM, and do still get the same error after that?