Just noticed that Open-VMConsoleWindow no longer works ? Or did something change that I'm not aware of ? I can run VMRC from vSphere Web Client; also from PowerShell using this approach.
PS C:\PowerCLI\_> get-vm xxxx | Open-VMConsoleWindow
Open-VMConsoleWindow : A general system error occurred: Authorize Exception
In Zeile:1 Zeichen:23
+ get-vm xxxx | Open-VMConsoleWindow
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Open-VMConsoleWindow], VimException
+ FullyQualifiedErrorId : VMware.Vim.VimException,VMware.VimAutomation.ViCore.Cmdlets.Commands.OpenVMConsoleWindow
Some info:
Windows 10 1803
PS C:\PowerCLI\_> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17134 228
PS C:\PowerCLI\_> Get-PowerCLIModules
Name Version
---- -------
VMware.DeployAutomation 6.7.0.8250345
VMware.ImageBuilder 6.7.0.8250345
VMware.PowerCLI 11.0.0.10380590
VMware.Vim 6.7.0.10334489
VMware.VimAutomation.Cis.Core 11.0.0.10335701
VMware.VimAutomation.Cloud 11.0.0.10379994
VMware.VimAutomation.Common 11.0.0.10334497
VMware.VimAutomation.Core 11.0.0.10336080
VMware.VimAutomation.HA 6.5.4.7567193
VMware.VimAutomation.HorizonView 7.6.0.10230451
VMware.VimAutomation.License 10.0.0.7893904
VMware.VimAutomation.Nsxt 11.0.0.10364044
VMware.VimAutomation.PCloud 10.0.0.7893924
VMware.VimAutomation.Sdk 11.0.0.10334495
VMware.VimAutomation.Security 11.0.0.10380515
VMware.VimAutomation.Srm 10.0.0.7893900
VMware.VimAutomation.Storage 11.0.0.10380343
VMware.VimAutomation.StorageUtility 1.3.0.0
VMware.VimAutomation.Vds 11.0.0.10336077
VMware.VimAutomation.Vmc 11.0.0.10336076
VMware.VimAutomation.vROps 10.0.0.7893921
VMware.VumAutomation 6.5.1.7862888
Dear dmcdonough,
that function has definitely saved my day! :smileygrin:
Many thanks!!
Obviously, many thanks to LucD as well
Best regards,
Pablo
Hi guys,
Any update on this issue? I have recently upgraded to vsphere 6.7 and I now run in to the issue described here. never had the issue with vsphere 6.0.
That was fixed in PowerCLI 12.0
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That error seems to say that you are not connected to a vSphere server.
Did you do a Connect-VIServer first?
The error in fact states that the Get-VM didn't work due to that reason.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I just noticed on your first screenshot that you still seem to have modules from PowerCLI 6.5 installed.
Did you remove that version via Programs and Features?
That is an MSI install.
Best would be to remove all PowerCLI related files and folders (after the MSI uninstall), and start fresh with Install-Module.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sounds good thank you. Just to confirm, are all PowerCLI related folders under "C:\Program Files\WindowsPowerShell\Modules" with any VMWare.* folder?
That depends on which Scope you specify on Install-Module.
With Scope AllUsers the modules go to C:\Program Files\WindowsPowerShell\Modules,
with Scope CurrentUser they go to your personal Documents folder under Documents\WindowsPowerShell\Modules
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Okay, I am doing this as an admin so I have confirmed that there are no VMWare.* files in my C:\Program Files\WindowsPowerShell\Modules folder. Also confirmed that there are no modules in my Documents\WindowsPowerShell\Modules directory as well.
This was done using the following command: (Get-Module VMware.PowerCLI -ListAvailable).RequiredModules | Uninstall-Module -Force
Then went with fresh install of PowerCLI using: Install-Module VMware.PowerCLI -Scope AllUsers
Also did it for current scope: Install-Module VMware.PowerCLI -Scope CurrentUser
Proceeded to connect to vcenter server and used "Open-VMConsoleWindow" and still came to same error.
What are the commands to see the version of PowerCLI and it's dependencies to confirm I have all right versions?
Hi @DCasota , I remember I haven't uninstalled VMRC! I will give that a try thanks for the advice.
Does Get-Module -Name VMware* -ListAvailable still show the old 6.5 modules?
Is there a PowerCLI entry under Programs and Features in the Control Panel?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I don't believe so. See attached picture, some are v 7.x or 1.x but I believe they came with fresh install. Still come to same problem even after uninstalling VMRC and running @DCasota snippet. Should there be another PowerCLI under programs and features or was that a legacy feature?
No, those are the version that came with PowerCLI 12.2.
Just to make sure, you did stop/start your PowerShell session after the removal and the fresh install of 12.2?
On another note, did you try the bypass snippet I posted earlier in this thread?
Does that work?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Apologies but to be painfully clear: I did stop/start after the removal and fresh install, i.e. I removed, fresh installed, closed instance of powershell, started new powershell instance, then tried to open-VMconsole window. Is that what you mean? Or should I have started a new instance after removal / before fresh install?
Unfortunately I haven't tried your method. I am doing research for a university that utilizes the Open-VMConsoleWindow command and I am unable to change it and need to utilize that command as of right now. If there isn't another option, I may be able to utilize your workaround.
As another option, did you try the same from a PSv7 session?
You can install PSv5.1 and PSv7 side-by-side on a Windows box.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
My bad, the code snippet was from an old PowerCLI project and does not handle future version checking.
Prerequisites of PowerCLI 12.2 with VMRC Release 12 : On the same Windows machine: .NET framework 4.7.2 or later, and Windows Powershell 5.1
In order for the Open-VMConsoleWindow cmdlet to work on all OS types VMware Remote Console (VMRC) also needs to be installed.
Just spottted many good advices earlier in this post. If the workaround @LucD mentioned earlier in this post doesn't work, the migration&cleanup of the chain dependency of WindowsPatches-PowershellModules-PowerCLI might not be finished.
@LucD No I haven't tried any other version of powershell but will experiment with that today and will let you know if that works. @DCasota thanks for the catch I will reinstall VMRC again and see if that also makes a change.
The only other dependencies required for PowerCLI Open-VMConsoleWindow PowerCLI 12.2 Module and VMRC module correct?
I reconfigured VMRC 12, with Powershell 5.1 and powerCLI 12.2 and still reach same error. Will attempt with different versions of powershell now.
I have also taken a look at the VMWare PowerCLI User Guide and I don't see any reference to a Open-VMConsoleWindow command. Is the command depreciated?