Assign RDM License using Powershell cmdlets

Implemented

Assign RDM License using Powershell cmdlets

0 vote

avatar

We have automated our user account creation process for RDM. Our script takes Active Directory Users and creates RDM accounts for them based on AD group membership. The script utilizes the New-RDMUser cmdlet. The cmdlet, however, does not support assigning licenses to the users. Automatic license assignment as configured in the GUI does not assign licenses to users created with the New-RDMUser cmdlet. As a result, we have to manage license assignment manually.

Please add a switch to the New-RDMUser cmdlet for assigning licenses. Alternatively, please add a new cmdlet for license management.

This request originated from DEVO-27226 RDM: Automatic license assignment with new-rdmuser cmdlet .

All Comments (12)

avatar

I've created a feature request. It will be prioritized and scheduled. We will let you know when this is available in RDM.

Best regards,

Stéfane Lavergne

avatar

I also look forward to this one.

avatar

Ran into the same issue. Look forward to when this is implemented.

avatar

Is there any update on this issue?

avatar

Hello,

This is still under investigation. I will ask to bump up the priority of this ticket.

Thank you for your patience.

Best regards,

Érica Poirier

avatar

Hello,

The improvement has been released in the new RDM PowerShell module version 2021.2.0.16 available on PowerShell Gallery. Please note that this new module is supported only with RDM version 2021.2.x or higher.

Here is the online documentation on how to install this new module.
https://help.remotedesktopmanager.com/psmodule.html

Best regards,

Érica Poirier

avatar

Hi,

Thanks for the update! Could you please provide a basic example on how to assign a license using the New-RDMUser cmdlet? I could not find any hints from the documentation or the built-in help provided with the Powershell module.

Best regards,

Antti Koskenvoima

avatar

Hello,

Here's what it'd look like :

# create user
$u = New-RDMUser <You already have that>
# fetch license from serial
$l = Get-RDMLicense -Serial "<serial>"
# get the assignation
$userlic = (Get-RDMLicense $l.License).Users | Where-Object{$_.UserID -eq $u.ID}
$userlic.IsMember = $True
# save changes
Set-RDMLicense $l

I hope this helps!
Best regards,

Alex Belisle

avatar

Hi the license assignment isn't saving for me.

PS C:\Scripts> $userlic = (Get-RDMLicense $l.License).Users | Where-Object {$_.UserID -eq $t.ID}
PS C:\Scripts> $userlic.IsMember
False
PS C:\Scripts> $userlic

Description :
HasActiveLicenseForSameProduct : False
IsAdministrator : False
IsMember : False
Name : Domain\Jim.Shelton
Serial : XXXX
UserId : cd2578c5-cd6f-4128-b47b-21f424341f3d

PS C:\Scripts> $userlic.IsMember = $True
PS C:\Scripts> Set-RDMLicense $l
PS C:\Scripts> Update-RDMUI
PS C:\Scripts> $userlic

Description :
HasActiveLicenseForSameProduct : False
IsAdministrator : False
IsMember : True
Name : Domain\Jim.Shelton
Serial : XXXX
UserId : cd2578c5-cd6f-4128-b47b-21f424341f3d

PS C:\Scripts> $userlic = (Get-RDMLicense $l.License).Users | Where-Object {$_.UserID -eq $t.ID}
PS C:\Scripts> $userlic

Description :
HasActiveLicenseForSameProduct : False
IsAdministrator : False
IsMember : False
Name : Domain\Jim.Shelton
Serial : XXXX
UserId : cd2578c5-cd6f-4128-b47b-21f424341f3d

avatar

Hello Ryan,

You're right, I made a tiny mistake.
Here's the corrected script

# create user
$u = New-RDMUser <You already have that>
# fetch license from serial
$l = Get-RDMLicense -Serial "<serial>"
# get the assignation
$userlic = $l.Users | Where-Object{$_.UserID -eq $u.ID}
$userlic.IsMember = $True
# save changes
Set-RDMLicense $l

My mistake was that we were working on a reference of a copy of the actual value... Anyway long story short, this should work.
This will also be available on our Github : GitHub - Devolutions/RDMSamples-ps: Remote Desktop Manager (RDM) samples of powershell code

I hope this helps!

Have a great one.
Best regards,

Alex Belisle

avatar

That was it. Thanks for the reply!

avatar

Hello!

Very good! Thanks a lot for the feedback, I'm glad I could help.

Best regards,

Alex Belisle