Automation

 View Only
Expand all | Collapse all

Open-VMConsoleWindow Authorize Exception

LucD

LucDFeb 22, 2021 07:55 PM

apolonie

apolonieFeb 23, 2021 06:14 PM

Daniel Casota

Daniel CasotaFeb 22, 2021 09:13 PM

  • 1.  Open-VMConsoleWindow Authorize Exception

    Posted Oct 27, 2018 03:14 PM

    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



  • 2.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 27, 2018 05:28 PM

    Did you configure a 32-bit web browser with Set-PowerCIiConfiguration?

    Is the VMRC plugin installed for that browser?

    More setup info in Opening the Virtual Machine Remote Console through PowerCLI



  • 3.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 08:39 AM

    Thanky you very much for replying.

    So lets do some checking and tests.

    Seems its configured to use MSIE:

    PS C:\PowerCLI\_> get-powercliconfiguration | fl

    DefaultVIServerMode         : Multiple

    ProxyPolicy                 : UseSystemProxy

    ParticipateInCEIP           : False

    CEIPDataTransferProxyPolicy : UseSystemProxy

    DisplayDeprecationWarnings  : False

    InvalidCertificateAction    : Ignore

    WebOperationTimeoutSeconds  : 300

    VMConsoleWindowBrowser      : C:\Program Files\Internet Explorer\iexplore.exe

    Scope                       : Session

    DefaultVIServerMode         :

    ProxyPolicy                 :

    ParticipateInCEIP           : False

    CEIPDataTransferProxyPolicy :

    DisplayDeprecationWarnings  : False

    InvalidCertificateAction    : Ignore

    WebOperationTimeoutSeconds  :

    VMConsoleWindowBrowser      :

    Scope                       : User

    DefaultVIServerMode         : Multiple

    ProxyPolicy                 :

    ParticipateInCEIP           :

    CEIPDataTransferProxyPolicy :

    DisplayDeprecationWarnings  :

    InvalidCertificateAction    :

    WebOperationTimeoutSeconds  :

    VMConsoleWindowBrowser      : C:\Program Files\Internet Explorer\iexplore.exe

    Scope                       : AllUsers

    So I tested:

    via MSIE log into https://vcenter/ui (which is 6.5U1 until I get backup support for 6.7U1)

    select VM

    open web console - OK

    open VMRC - OK

    Other installed browsers are Chrome and Firefox 64 bit. Usually I use Chrome to access web client.

    Fun fact:

    Just tried this on my Mac. Get the message that PowerShell Core doesn't support Open-VMConsoleWindow. But using the other approach  works :smileygrin:

    function Open-MyVMConsoleWindow {

    <#

        .Synopsis

        Function to replicate Open-VMConsoleWindow but use the VMware Remote Console Application

        .Description 

        Connect to the virtual machine using the currently connected server object.

        .Example

        Get-VM "MyVM" | Open-MyVMConsoleWindow

        .Parameter VirtualMachine

        Virtual Machine object

        .notes

        csdibiase 2016 https://communities.vmware.com/thread/539980 

        PowerCLI 5.5R1: Open-VMConsoleWindow

    #>

        [CmdletBinding()]

        param (

            [Parameter(Mandatory=$true,ValueFromPipeline=$True)]

            [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]$vm

        )

       

        process {

            $ServiceInstance = Get-View -Id ServiceInstance

            $SessionManager  = Get-View -Id $ServiceInstance.Content.SessionManager

            $vmrcURI = "vmrc://clone:" + ($SessionManager.AcquireCloneTicket()) + "@" + $global:DefaultVIServer.Name + "/?moid=" + $vm.ExtensionData.MoRef.Value

            Start-Process -FilePath $vmrcURI

        }

    }



  • 4.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 10:17 AM

    That is correct Open-VMConsoleWindow is not supported in PSv6 (which is the one that runs on Mac and Linux).

    I was able to recreate your issue.

    On a vCenter that has a self-signed certificate I get the same Authorize exception.
    On a vCenter that has a "real" certificate, I don't get the error.
    And my PowerCLI session is configured to "ingnore" invalid certificates. So that seems to be an "issue".

    Btw, it looks as if there no more browser in play in the later PowerCLI versions (I tested with PowerCLI 11.0.0).
    The vmrc.exe is included in the VMware.VimAutomation.Core module.
    Note that it is only included in the net45 branch and not in the netcoreapp2.0, which explains why it will not work on PSv6 (Linux & MAc)

    That gave me the opportunity to roll my own Open-VmConsoleWindow as a bypass.

    The following seems to work for me, even with self-signed certificates.

    This is vSphere 6.5, PowerCLI 11.0.0 and VMRC 10.0.3 (that comes with the PowerCLI module)

    $vmName = 'MyVM'

    $moduleName = 'VMware.VimAutomation.Core'

    $module = Get-Module -Name $moduleName -ListAvailable

    $vmrcPath = "$($module.ModuleBase)\net45\VMware Remote Console\vmrc.exe"

    $vm = Get-VM -Name $vmName

    $mks = $vm.ExtensionData.AcquireMksTicket()

    $parm = "vmrc://$($vm.VMHost.Name):902/?mksticket=$($mks.Ticket)&thumbprint=$($mks.SslThumbPrint)&path=$($mks.CfgFile)"

    & "$vmrcPath" $parm



  • 5.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 12:41 PM

    Just tested your code; it works well (as always).

    Added a function Open-LucDVMConsoleWindow to my module collection :smileygrin:



  • 6.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 01:34 PM

    BTW if there are old module versions it throws an error. Changed it to select the latest one:

    $module = Get-Module -Name $moduleName -ListAvailable | Sort-Object -Property 'Version' | Select-Object -Last 1



  • 7.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 01:43 PM

    Nice catch.
    I throw older versions away when I install a new PowerCLI version.
    Remove -WhatIf if you are sure the correct modules are selected.

    Get-Module -Name VMware* -ListAvailable |

    Group-Object -Property Name | where{$_.Count -gt 1} | %{

        $_.Group | Sort-Object -Property Version -Descending | Select -Skip 1 | %{

            Uninstall-Module -Name $_.Name -RequiredVersion $_.Version -Force -Confirm:$false -WhatIf

        }

    }



  • 8.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 02:33 PM

    Actually I searched for old module cleanup some days earlier and already found this here but didn't run cleanup on all systems :smileygrin:



  • 9.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Mar 07, 2019 03:52 PM

    LucD's script worked for me, thank you.Still broken though with 11.2



  • 10.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Mar 07, 2019 04:00 PM

    Which vSphere version?
    I tested with PowerCLI 11.2.0 and vSphere 6.7



  • 11.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Mar 20, 2019 08:18 AM

    I have PowerCLI 11.2.0.12780525 with vSphere 6.5 and Open-VMConsoleWindow still doesn't work.  The script you posted works fine.

    Cheers  Mark



  • 12.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 01, 2019 05:53 PM

    Same here, with PCLI 11.2, PS 5.1, against vSphere 6.5U1

    [PS]> get-vm XXXXXXXX | open-vmconsolewindow

    open-vmconsolewindow : A general system error occurred: Authorize Exception

    At line:1 char:23

    + get-vm XXXXXXXX | open-vmconsolewindow

    +                       ~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [Open-VMConsoleWindow], VimException

        + FullyQualifiedErrorId : VMware.Vim.VimException,VMware.VimAutomation.ViCore.Cmdlets.Commands.OpenVMConsoleWindow



  • 13.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 01, 2019 06:58 PM

    6.5 U1



  • 14.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 02:35 PM

    I added a little bit to LucD's code to make a full function that acts more like a full drop-in replacement for Open-VMConsoleWindow.

    function Open-VMConsole {

      #requires -Module VMware.VimAutomation.Core


      Param(

        [Parameter(ParameterSetName = 'PassByVMObject',

          Mandatory = $true,

          ValueFromPipeline = $true)]

        [ValidateNotNullOrEmpty()]

        [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl[]]$VM,


        [Parameter(ParameterSetName = 'PassByVMName',

          Mandatory = $true,

          ValueFromPipeline = $true)]

        [ValidateNotNullOrEmpty()]

        [string[]]$VMName,


        [Parameter(Mandatory = $false)]

        [string]$VMRC = "C:\Program Files (x86)\VMware\VMware Remote Console\vmrc.exe"

      )


      begin {

        # Hold all the VMs we want to launch

        $VMs = @()

      }


      process {

        # Add all the VMs to the VM list - load the VM info if need be...

        if($PSCmdlet.ParameterSetName -eq 'PassByVMObject') {

          $VM | ForEach-Object { $VMs += $VM }

        } else {

          $VMName | ForEach-Object { $VMs += Get-VM $_ }

        }

      }


      end {

        $VMs | Foreach-Object {

          # Acquire MKS ticket

          $MKSTicket = $_.ExtensionData.AcquireMksTicket()


          # Build the URI

          $VMRC_URI = "vmrc://$($_.VMHost.Name):902/?mksticket=$($MKSTicket.Ticket)&thumbprint=$($MKSTicket.SslThumbPrint)&path=$($MKSTicket.CfgFile)"


          # Launch

          & "$VMRC" $VMRC_URI

        }

      }

    }



  • 15.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 02:39 PM

    Thanks for sharing.

    Did you by any chance, also try Open-VmConsoleWindow with PowerCLI 11.3.0?



  • 16.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 02:48 PM

    Did you by any chance, also try Open-VmConsoleWindow with PowerCLI 11.3.0?

    Yes, I was really hoping 11.3.0 would solve my issue.  I had it working properly with 11.2.0 prior to having my laptop reimaged.  I can't for the life of me remember what I had done to make it work.



  • 17.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 03:04 PM

    Do you perhaps have multiple PowerCLI versions installed?
    That was a problem



  • 18.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 04:24 PM

    Nope.  Fresh install of the OS, so nothing lingering.  Fresh install of 11.3.0.

    I've tried setting my config to point at vmrc.exe and my browser (Firefox) and neither works, same error recurs.



  • 19.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 05:09 PM

    Did you set the PowerCli configuration InvalidCertificateAction to Ignore?



  • 20.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 06:00 PM

    Yes, it is.  I've gone through the other things in this thread and confirmed the configuration to the best of my ability.

    I appreciate the help, though.  I wasn't really looking for more help to troubleshoot, I just wanted to share tweaks to the workaround that was provided.



  • 21.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 06:03 PM

    Bummer!
    But my earlier snippet which you turned into a function still works?



  • 22.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 06:06 PM

    Yes, it work's beautifully.  I just made it a full function, and made it accept pipeline input.  I was so used to running "Get-VM xxx | Open-VMConsoleWindow" that I wanted this to work the same.



  • 23.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2019 06:07 PM

    Good.
    I'm afraid you will have to live with that function for now.



  • 24.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 10:25 AM

    The older method you included in your previous reply will only work if you have the VMRC plugin installed in your default browser.

    My code does not need the browser plugin anymore (like the current PowerCLI version).



  • 25.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 12:29 PM

    Thank you very much.

    The vCenter certificate in my case isn't self signed; I've got a Windows CA; VMCA is configured as subordinate CA and I added the certificate of the windows ca as trusted CA. Chrome etc say its 'OK'.

    Set-PowerCLIConfiguration to warn... and it tells me the vCenter certificate is invalid since it can't access the CRL. Which is correct; this is a lab environment and I didn't care about CRLs until now (which would be BAD in a production environment).



  • 26.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Oct 28, 2018 12:36 PM

    Ok, that makes sense.

    Did you test my script?
    On a station where the VMRC browser plugin is not installed?
    The script should be in theory be completely browser independent.



  • 27.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Dec 06, 2018 07:01 AM

    I opened a support case for this and got this update: The problem will be fixed in v11.2. At the moment they're working on releasing 11.1, so we'll have to wait a bit.



  • 28.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Mar 06, 2019 10:32 AM

    v11.2 is out, can someone confirm issue is fixed, as mine still persists...



  • 29.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Mar 06, 2019 10:53 AM

    For me it is working.



  • 30.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Mar 07, 2019 03:47 PM

    I am having this issue too.

    I did not have the issue on Windows 10 build 1709 but now that I have updated to build 1803 I have this issue.

    I have no issues with open-vmconsolewindow when I am connected to our server vcenter, it only exists when connecting to our vdi vcenter.

    server vcenter is version 6, vdi vcenter is 6.5



  • 31.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 24, 2019 03:02 PM

    Im on 11.3 PowerCLI / Vsphere 6.7.0 13639324 and I'mm still seeing the issue.

    The script posted does help, but annoying having to remember to drop it in profiles from the various servers.

    Does anyone know what the actual problem is with the command?

    I checked the Cert and indeed it does state that it cannot check the CRL so its therefore invalid.

    I'll see if i can replace with an internal CA cert.



  • 32.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 25, 2019 11:06 AM

    just updated to v11.3 and still "Open-VMConsoleWindow : A general system error occurred: Authorize Exception"

    I opened a support request and pointed to my last SR where I was told that it will be resolved in 11.2.

    (for vmware employees: SR 19009423006, old one 18956929110)

    edit: just got a call. GSS told me it's on engineering's list, but low priority because there is a workaround. No info yet when it will be worked on, but a kb article (68186) is in the making and will be released soon.



  • 33.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Sep 03, 2019 01:24 PM

    August 2019 and it's still happening. Here's a more robust version of LucD's script, it at least lets you pipe in VMs:

    function Open-VMConsoleWindow2 {

        [cmdletbinding()]

        param(

            [parameter(ValueFromPipeline)]

            [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl[]]$vm

        )

        begin {

            $vmrcUri = 'vmrc://{0}:902/?mksticket={1}&thumbprint={2}&path={3}'

        }

        process {

            foreach ($a_vm in $vm) {

                $mks = $a_vm.ExtensionData.AcquireMksTicket()

                Write-Verbose "Opening Uri '$vmrcUri'"

                Start-Process ($vmrcUri -f $a_vm.VMHost.Name, $mks.Ticket, $mks.SslThumbPrint, $mks.CfgFile)

            }

        }

    }

    Also, the get-module part doesn't seem necessary if you have VMRC installed correctly, so I dropped it (it had issues if you had multiple versions of PowerShell installed anyway).



  • 34.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 20, 2020 11:31 AM

    So - now the above method doesn't work either, as VMware have removed VMRC from PowerCLI module as of Version 12 so you can no longer call vmrc.exe from the VMware.VimAutomation.Core component folder?

    Is there any way around this without installing VMRC or are we back to that dependency now?

    LucD



  • 35.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 20, 2020 11:35 AM

    I think the Help page for the Open-VMConsoleWindow is clear.

    It says "This cmdlet assumes that either VMware Remote Console, VMware Workstation or VMware Fusion is installed."



  • 36.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 20, 2020 11:53 AM

    Yes I;ve seen it thanks, just seems a odd that there's no method to launch a console just using Powershell without any dependencies...



  • 37.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 20, 2020 11:59 AM

    The basic issue might be that PowerCLI is multi-platform.
    On the positive side, VMRC is available for Windows, Linux and MacOS



  • 38.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2020 09:16 AM

    Hi

    I just upgraded vcenter from 6.0 to vcsa 6.7

    i get error

    Open-VMConsoleWindow : A general system error occurred: Authorize Exception

    At line:1 char:23

    I tried the function does not work for me

    However, if I log into the vCenter server locally, and use a local Windows account in vSphere web client , then try connect vm , i get warning for cert but i can connect - it works OK.

    I am using

    PowerCLI Version

    ----------------

       VMware PowerCLI 12.0.0 build 15947286

    ---------------

    Component Versions

    ---------------

       VMware Common PowerCLI Component 12.0 build 15939652

       VMware Cis Core PowerCLI Component PowerCLI Component 12.0 build 15939657

       VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 12.0 build 15939655

    ==

    Major  Minor  Build  Revision

    -----  -----  -----  --------

    5      1      18362  752

    ==

    also have Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

    Please suggest



  • 39.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2020 01:06 PM

    Did you use the same account for the Connect-VIServer cmdlet and for logging into the Web Client?
    What error does the function return?



  • 40.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 21, 2020 09:45 PM

    Again the error i got with other user as well

    Open-VMConsoleWindow : A general system error occurred: Authorize Exception

    At line:1 char:22

    + get-xxxxx |Open-VMConsoleWindow

    +                      ~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [Open-VMConsoleWindow], VimException

        + FullyQualifiedErrorId : VMware.Vim.VimException,VMware.VimAutomation.ViCore.Cmdlets.Commands.OpenVMConsoleWindow

    ===

    I was able to fix this with below change of path ! somehow vmrc.exe did not in the path in my case....

    $vmName = 'xxxxx'

    $moduleName = 'VMware.VimAutomation.Core'

    $module = Get-Module -Name $moduleName -ListAvailable

    #$vmrcPath = "$($module.ModuleBase)\net45\VMware Remote Console\vmrc.exe"

    $vmrcPath = "C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation.Core\11.5.0.14899560\net45\VMware Remote Console\vmrc.exe"

    $vm = Get-VM -Name $vmName

    $mks = $vm.ExtensionData.AcquireMksTicket()

    $parm = "vmrc://$($vm.VMHost.Name):902/?mksticket=$($mks.Ticket)&thumbprint=$($mks.SslThumbPrint)&path=$($mks.CfgFile)"

    & "$vmrcPath" $parm



  • 41.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Jun 30, 2020 04:08 PM

    Dear dmcdonough​,

    that function has definitely saved my day! :smileygrin:

    Many thanks!!

    Obviously, many thanks to LucD​ as well :smileyhappy:

    Best regards,

    Pablo



  • 42.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 07:50 PM

    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. 



  • 43.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 07:55 PM

    That was fixed in PowerCLI 12.0



  • 44.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 08:11 PM
      |   view attached

    Hi LucD,

    I seem to have PowerCLI 12.2 installed, could you see from my dependency versions what my other issue may be? Unfortuantely I'm quite new to vSphere and attempting to learn as I go!



  • 45.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 08:14 PM

    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.



  • 46.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 08:16 PM
      |   view attached

    Yes, sorry I must have forgot to reconnect. Attached is image with relevant error.



  • 47.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 08:31 PM

    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.



  • 48.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 08:39 PM

    Sounds good thank you. Just to confirm, are all PowerCLI related folders under "C:\Program Files\WindowsPowerShell\Modules" with any VMWare.* folder? 



  • 49.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 08:44 PM

    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



  • 50.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 09:30 PM

    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?



  • 51.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 09:41 PM

    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?



  • 52.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 10:21 PM
      |   view attached

    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   snippet. Should there be another PowerCLI under programs and features or was that a legacy feature?



  • 53.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 10:34 PM

    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?



  • 54.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 10:38 PM

    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.



  • 55.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 10:55 PM

    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.



  • 56.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 11:45 PM

    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  mentioned earlier in this post doesn't work, the migration&cleanup of the chain dependency of WindowsPatches-PowershellModules-PowerCLI might not be finished.

     



  • 57.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 04:07 PM

     No I haven't tried any other version of powershell but will experiment with that today and will let you know if that works.  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?



  • 58.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 04:26 PM

    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? 

    https://vdc-download.vmware.com/vmwb-repository/dcr-public/adea0282-67ca-4678-8d0d-95d266f6c336/2c078eed-213a-4b35-b958-07a262625ab1/vmware-powercli-122-user-guide.pdf

     



  • 59.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 04:43 PM
      |   view attached

    Unfortunately same error with powershell v7.1.2, see attached picture. Any other ideas?



  • 60.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 05:00 PM

    One thing you could try is to install PowerCLI 10.2.
    The cmdlet worked in that version.
    Curious to see if that works in your environment



  • 61.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 05:31 PM

    Okay removing everything and will try PowerCLI 10.2 with VMRC 12. Will test on both PS v5 and v7. 



  • 62.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 05:35 PM

    Don't bother with PSv7, that PowerCLI version only works with PSV5



  • 63.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 05:47 PM

    Same error, but oddly enough if I run the Get-PowerCLIVersion cmdlet it returns that I'm running PowerCLI 12.2.0 even after wiping 12.2.0 and installing 10.2.0. I confirmed that there were no files in my Documents\WindowsPowershell\Modules as well as \System32\Program Files\WindowsPowershell\Modules folder relating to VMware. Is there something I'm missing?



  • 64.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 05:53 PM

    What does Get-Module -Name VMware* -ListAvailable return?



  • 65.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 06:14 PM
      |   view attached

    Here is attached cmdlet output. 



  • 66.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 06:21 PM

    You are still running PowerCLI 12.2
    Delete those folders manually, then install 10.2 from the ZIP file.
    Do not forget to unlock the ZIP file.



  • 67.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 06:45 PM
      |   view attached

    Attached image is powercli modules from 10.2 zip file. Unfortunately when trying to connect to vcenter server I receive error about the vmware.vimAutomation.core package.



  • 68.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 06:48 PM
      |   view attached

    Attached is error when importing vmware.vimautomation.core package.



  • 69.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 06:52 PM

    What do you have in $env:PSModulePath?



  • 70.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 06:56 PM
      |   view attached

    Apologies I'm making things so difficult, here is attached picture of env path. Also attempted moving the module folders to my user/Documents/WindowsPowershell/Modules folder with same error.



  • 71.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 07:29 PM

    Did you unlock the ZIP (Unblock-File) file after you downloaded it?



  • 72.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 07:37 PM

    I extracted the files and "unzipped" it if that's what you're referring to. Also, where should the folders optimally be? I was reading one of your other threads: https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-offline-installation/td-p/2292588 where you suggested that the files should ultimately be within the personal user\documents\windowspowershell folder instead of the Program Files\Windows Powershell folder.

     

    Also, would my personal folder being in a network drive have any affect on powercli? 



  • 73.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 07:41 PM

    No, you also have to unlock a file you downloaded.
    See Solved: Installing PowerCLI - VMware Technology Network VMTN

    Older versions of PS had issues with modules on network drives.
    Not 100% sure if that still could have an impact.
    To avoid that, install the modules in C:\Program Files\WindowsPowerShell\Modules



  • 74.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 08:02 PM

    Wow! The command:  Get-ChildItem -Path "C:\Program Files\WindowsPowerShell\Modules\VMware*" -Recurse | Unblock-File worked to unblock the files and I can now connect seamlessly.

    To anybody else having the issue: this is what worked for me.

    Powershell version: 5.7

    PowerCLI version: 10.2

    VMRC version: 12

    PowerCLI modules downloaded in: "C:\Program Files\WindowsPowerShell\Modules" must be unblocked using Get-ChildItem command.

     

    Major, major kudos to you , certainly wouldn't have been able to have done it on my own. Much thanks to you!



  • 75.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 08:07 PM

    Ok, but you are using an older PowerCLI version.
    The problem with 12.2 is still there?
    Or did you also install that from a ZIP file?



  • 76.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 08:13 PM

    When I installed 12.2 I used the Install-Module cmdlet to install, do you need to use the unblock-file command on those folders as well? I will attempt upgrade tomorrow and update you with details.



  • 77.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 23, 2021 08:17 PM

    No, not in that case



  • 78.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 03, 2022 03:17 PM

    Anyone got this working in PowerShell 7 / PowerCli 12.5 / VMRC 12.01?  I keep getting the authorised denied message when I try get-vm i.e.

    Open-VMConsoleWindow: A general system error occurred: Authorize Exception

    VMRC works fine and this worked fine until I upgraded.

     



  • 79.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 03, 2022 03:50 PM

    Works for me, but I'm using VMRC 11.1.0 build-15913118



  • 80.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 03, 2022 05:20 PM

     it works even with a remote ESXi on Arm system + w10 x64 [Powershell 7.2.2, PowerCLI 12.5, VMRC 12.01].



  • 81.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Apr 03, 2022 06:46 PM

    Thanks both - how odd.  Not sure how to proceed now,  let me look at some logs



  • 82.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 09:13 PM

     

     



  • 83.  RE: Open-VMConsoleWindow Authorize Exception

    Posted Feb 22, 2021 09:32 PM

    Hi  , I remember I haven't uninstalled VMRC! I will give that a try thanks for the advice.