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.

4 votes
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

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

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Anonymous commented  ·   ·  Flag as inappropriate

    I can confirm this bug and that the fix provided by Kurt Bonne works. Please fix or provide with instructions on how to move this issue forward.

Feedback and Knowledge Base