1 2 Previous Next 23 Replies Latest reply on Apr 16, 2013 7:30 AM by davidstamen

    PowerCLI 4.1 Opens and Closes on 2008 R2 Server

    Ranger275 Novice

       

      I have read the communities for years and normally find the answer to all my ills here.  Unfortunately I cannot find an answer and even the mighty Google doesn't seem to help.  Here goes my first post...

       

       

       

       

       

      I have a VM I work from.  I call it my toolbox.  I load all my programs, tools, and settings to it.  No matter where I go, I can RDP to it and get to work fast.  I recently spun up a 2008 R2 VM and loaded vSphere PowerCLI 4.1.  When it launches, it opens and quickly closes.  I have tried running the commands that are found in the PowerCLI shortcut from a PowerShell 2.0 prompt to no avail.  I can run commands in PowerGUI Script Editor and that works like a champ.  The supported OS doc says Server 2008 is supported, but there is no mention of 2008 R2.  Windows 7 is supported so I just figured that 2008 R2 would be OK.  I can't find a smoking gun in the Event logs.  I also tried installing in compatibility mode.  No luck.

       

       

      Any ideas?

       

       

      Thanks for your help,

       

       

      Sean

       

       

        • 1. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
          LucD Guru
          User ModeratorsCommunity WarriorsvExpert

          Can you load the PowerCLI snapin from the PS v2 prompt ?

          Add-PSSnapin VMware.VimAutomation.Core
          

          I suppose so since PowerGui works.

           

           

           

           

           

          ____________

          Blog: LucD notes

          Twitter: lucd22

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
            Ranger275 Novice

             

            It looks like it loads.  I am still unable to launch from the PowerCLI shortcut.

             

             

             

             

            Windows PowerShell
            +     Copyright (C) 2009 Microsoft Corporation. All rights reserved.+
            +     PS H:\> add-pssnapin vmware.vimautomation.core+
            +     PS H:\>+

             

            • 3. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
              LucD Guru
              Community WarriorsUser ModeratorsvExpert

              Did you try executing the Initialize-VIToolkitEnvironment.ps1 script (in the Scripts directory) from the PS v2 prompt (after you loaded the snapin) ?

              Perhaps the

              [void][http://Reflection.Assembly|http://Reflection.Assembly]::LoadWithPartialName("VMware.Vim")
              

              is causing the problem.

               

               

               

               

              ____________

              Blog: LucD notes

              Twitter: lucd22

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                Ranger275 Novice

                Looks like we are getting somewhere.

                 

                PS D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\scripts> initialize-vitoolkitenvironment.ps1

                               The term 'initialize-vitoolkitenvironment.ps1' is not recognized as the name of a cmdlet, function, script file, or ope

                               rable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again

                               .

                               At line:1 char:36

                               + initialize-vitoolkitenvironment.ps1 <<<<

                               + CategoryInfo          : ObjectNotFound: (initialize-vitoolkitenvironment.ps1:String) [], CommandNotFoundExceptio

                               n

                               + FullyQualifiedErrorId : CommandNotFoundException

                 

                 

                               Suggestion : The command initialize-vitoolkitenvironment.ps1 was not found, but does exist in the current loc

                               ation. Windows PowerShell doesn't load commands from the current location by default. If you trust this command, instead

                               type ".\initialize-vitoolkitenvironment.ps1". See "get-help about_Command_Precedence" for more details.

                               PS D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\scripts> .\initialize-vitoolkitenvironment.ps1

                               Welcome to the VMware vSphere PowerCLI!

                 

                               Log in to a vCenter Server or ESX host:              Connect-VIServer

                               To find out what commands are available, type:       Get-VICommand

                               To show searchable help for all PowerCLI commands:   Get-PowerCLIHelp

                               Once you've connected, display all virtual machines: Get-VM

                               If you need more help, visit the PowerCLI community: Get-PowerCLICommunity

                 

                               Copyright (C) 1998-2010 VMware, Inc. All rights reserved.

                 

                               PS D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\scripts>

                 

                • 5. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                  Hot Shot

                  Hi Sean,

                   

                  Can you try something which may help us to understand the reason for that problem?

                   

                  1. Choose properties on PowerCLI shortcut and copy the value from Target field on Shortcut page.

                  2. Start cmd.exe

                  3. Paste the command and run it

                  4. Show us the error that you see (if there's a error)

                   

                  There should be two PowerCLI shortcuts on your desktop (PowerCLI and PowerCLI 32 bit).

                  Did you try to run both? Do both of them open and close?

                   

                  Thanks,

                   

                  Vitali

                  PowerCLI team

                  • 6. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                    LucD Guru
                    Community WarriorsUser ModeratorsvExpert

                    Isn't this due to the security policy ?

                    That script is a signed script, did you do a

                    Set-SecurityPolicy RemoteSigned
                    

                     

                     

                     

                     

                    ____________

                    Blog: LucD notes

                    Twitter: lucd22

                    Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                    1 person found this helpful
                    • 7. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                      Ranger275 Novice

                       

                      Vitali,

                       

                       

                      Here you go and yes they both open and close.  I also spun up another 2008 R2 VM and only installed PowerCLI 4.1 and got the same result.  Thank you for the help.

                       

                      VMware vSphere PowerCLI Shortcut

                       

                       

                       

                                     C:\Windows\system32>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -psc "D:\Program Files

                                     (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"D:\Program Files (x86)\VMware\I

                                     nfrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\""

                                     Internal Windows PowerShell error.  COM initialization failed while reading Windows PowerShell conso

                                     le file with error 80010106.

                       

                       

                       

                      VMware vSphere PowerCLI (32-Bit) Shortcut

                       

                                     C:\Windows\system32>C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psc "D:\Program Files

                                     (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"D:\Program Files (x86)\VMware\I

                                     nfrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\""

                                     Internal Windows PowerShell error.  COM initialization failed while reading Windows PowerShell conso

                                     le file with error 80010106.

                       

                      • 8. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                        Ranger275 Novice

                         

                        LucD - Do you mean set-executionpolicy remotesigned?

                         

                         

                        • 9. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                          LucD Guru
                          Community WarriorsvExpertUser Moderators

                          Yes, sorry for the typo

                           

                           

                           

                           

                          ____________

                          Blog: LucD notes

                          Twitter: lucd22

                          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                          • 10. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                            Hot Shot

                            Hi Sean,

                             

                            It is possible this problem to be related in some way with the VIX component on which PowerCLI depends. Can you confirm that you have the latest version of it 1.10?

                            To check that , go to the VIX installation folder and see the version of VixCom.dll (properties of the file). The installation folder should be %Program Files%\Vmware\Vmware VIX\

                             

                            The official page of VIX component is:

                              http://www.vmware.com/support/developer/vix-api/

                             

                            Vitali

                            • 11. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                              Ranger275 Novice

                               

                              Here are the properties.

                               

                               

                               

                               

                               

                               

                               

                              • 12. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                                Hot Shot

                                Hi again,

                                 

                                Your version of VIX is correct.

                                 

                                I'm still unable to reproduce the situation on windows 2008 R2 server.

                                 

                                1. Can you try to run the shortcut as administrator?

                                or

                                2. Uninstall the VIX component and install it again

                                 

                                Vitali

                                1 person found this helpful
                                • 13. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                                  Ranger275 Novice

                                   

                                  Run as Administrator was no luck.

                                   

                                   

                                  Add/Remove Programs had VMware VIX version at 1.10.0.12331.  I found a new version on VMware.com.

                                   

                                   

                                  I installed VMware VIX version 1.10.1.12915.  Still no luck trying to launch PowerCLI.

                                   

                                   

                                  • 14. Re: PowerCLI 4.1 Opens and Closes on 2008 R2 Server
                                    nnedev Hot Shot
                                    VMware Employees

                                    Hi,

                                     

                                    I have some thoughts on the problem. Here are the areas that we should investigate:

                                     

                                    1. PowerCLI snapin - already checked. You are able to load our snapin in PS console 2. Initilize-VIToolkitEnvironment script - already checked. You running the scripts with no erros.

                                    3. PowerCLI console file - Go to PowerCLI installation folder and doubleclick on the vim.psc1 file. Verify that a new powershell popup window appears and PowerCLI snapin is loaded 4. PowerCLI shortcut - send us the shortcut file (VMware vSphere PowerCLI.lnk)

                                     

                                    Regards,

                                    Nedko Nedev

                                    PowerCLI Development Team

                                    1 2 Previous Next