Please feel free to provide feedback or file bugs here.

BUG: Get-RDSessionCollection always generates exception on Windows Server 2019

Get-RDSessionCollection of the RemoteDesktop module always throws an exception:
--

PS C:\windows\system32> Get-RDSessionCollection
New-Object : Exception calling ".ctor" with "1" argument(s): "Invalid parameter "
At C:\windows\system32\WindowsPowerShell\v1.0\Modules\RemoteDesktop\SessionDesktopCollection.psm1:520 char:14
+ ... $scope = New-Object System.Management.ManagementScope("\\" + $Conn ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

CollectionName Size ResourceType CollectionType CollectionDescription
-------------- ---- ------------ -------------- ---------------------
mycollection 0 RemoteApp programs PooledUnmanaged My first collection

PS C:\windows\system32>

--

Changing C:\Windows\System32\WindowsPowerShell\v1.0\Modules\RemoteDesktop\SessionDesktopCollection.psm1 line 520

$scope = New-Object System.Management.ManagementScope("\\" + $ConnectionBroker + "\" + $wmiNamespace, $connectionOptions)

into

$msuri = "\\" + $ConnectionBroker + "\" + $wmiNamespace
$scope = New-Object System.Management.ManagementScope($msuri, $connectionOptions)

fixes the problem.

This issue breaks our offering in the Azure Marketplace.

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Kurt Bonne shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base