First published on CloudBlogs on Apr, 07 2010
[Aug. 2010: Updated instructions for starting PowerShell in the RDS context] In Windows Server® 2008 R2, we introduced the Remote Desktop Services Provider for Windows PowerShell™ . This post gives examples of how you can use this new feature to manage Remote Desktop Licensing (RD Licensing). This post assumes that you have a basic understanding of Windows PowerShell. As you might already know, Windows PowerShell provides an easy scripting interface for performing administrative tasks. You can write Windows PowerShell scripts to automate the setup deployment per your requirements. Prerequisites: · Install the required Remote Desktop Services feature (that is, Remote Desktop Licensing for Example 1 and Remote Desktop Session Host for Example 2). · Start the Windows PowerShell command window and switch to RDS context:
where [AgreementNumber] refers to the Agreement Number for the licenses, [ProductVersion] refers to the version of the licenses. It has three possible values: 0 - Windows 2000 Server 1 - Windows Server 2003 2 - Windows Server 2008 or Windows Server 2008 R2 [ProductType] refers to the type of license. It has four possible values: 0 - for Per Device 1 - for Per User 4 - for VDI Standard 5 - for VDI Premium, and [LicenseCount] refers to the number of licenses that you want to install. c. Add the license server to the Terminal Server License Servers group on the domain controller by using the following command: PS RDS:LicenseServer> Set-Item .LSinTSLSGroup -Value 1 Note: To run this command, you need to have Enterprise Admin privileges. d. Query to see if the license server is registered in Service Connection Point (SCP) by using the following command: PS RDS:LicenseServer> Get-Item .SCPRegistrationStatus This command will show the current value, permissible values, and the permissible operations for the property. If the value of ‘SCPRegistrationStatus’ property is set to 1, it means that the license server is already registered in SCP. e. Generate the Per User license usage report by using the following command: PS RDS:LicenseServerIssuedLicensesPerUserLicenseReports> New-Item -Name [NameOfReport] -Scope [Scope] where [NameOfReport] is the name with which you want to refer to the report, and [Scope] represents the scope of the report. It can have three values: DOM - Generate a report for the entire domain ALLTRUSTEDDOM - Generate a report for all trusted domains OU - Generate a report for the organizational unit (OU) 2. On the Remote Desktop Session Host (RD Session Host) server: a. Specify the licensing mode on the RD Session Host server using the following command: PS RDS:RDSConfigurationLicensingSettings> Set-Item .LicensingType -Value [Type] where, the possible values of [Type] are: 2 - Per Device 4 - Per User b. In the Specified License Server list, add the license server name by using the following command: PS RDS:RDSConfigurationLicensingSettingsSpecifiedLicenseServers> New-Item -Name [LSName] where [LSName] refers to the name of the license server.
[Aug. 2010: Updated instructions for starting PowerShell in the RDS context] In Windows Server® 2008 R2, we introduced the Remote Desktop Services Provider for Windows PowerShell™ . This post gives examples of how you can use this new feature to manage Remote Desktop Licensing (RD Licensing). This post assumes that you have a basic understanding of Windows PowerShell. As you might already know, Windows PowerShell provides an easy scripting interface for performing administrative tasks. You can write Windows PowerShell scripts to automate the setup deployment per your requirements. Prerequisites: · Install the required Remote Desktop Services feature (that is, Remote Desktop Licensing for Example 1 and Remote Desktop Session Host for Example 2). · Start the Windows PowerShell command window and switch to RDS context:
- Click Start, click All Programs, and then click Administrative Tools.
- Right-click Windows PowerShell Modules, and then click Run as Administrator.
- In the PowerShell command window, type the following: cd RDS:
where [AgreementNumber] refers to the Agreement Number for the licenses, [ProductVersion] refers to the version of the licenses. It has three possible values: 0 - Windows 2000 Server 1 - Windows Server 2003 2 - Windows Server 2008 or Windows Server 2008 R2 [ProductType] refers to the type of license. It has four possible values: 0 - for Per Device 1 - for Per User 4 - for VDI Standard 5 - for VDI Premium, and [LicenseCount] refers to the number of licenses that you want to install. c. Add the license server to the Terminal Server License Servers group on the domain controller by using the following command: PS RDS:LicenseServer> Set-Item .LSinTSLSGroup -Value 1 Note: To run this command, you need to have Enterprise Admin privileges. d. Query to see if the license server is registered in Service Connection Point (SCP) by using the following command: PS RDS:LicenseServer> Get-Item .SCPRegistrationStatus This command will show the current value, permissible values, and the permissible operations for the property. If the value of ‘SCPRegistrationStatus’ property is set to 1, it means that the license server is already registered in SCP. e. Generate the Per User license usage report by using the following command: PS RDS:LicenseServerIssuedLicensesPerUserLicenseReports> New-Item -Name [NameOfReport] -Scope [Scope] where [NameOfReport] is the name with which you want to refer to the report, and [Scope] represents the scope of the report. It can have three values: DOM - Generate a report for the entire domain ALLTRUSTEDDOM - Generate a report for all trusted domains OU - Generate a report for the organizational unit (OU) 2. On the Remote Desktop Session Host (RD Session Host) server: a. Specify the licensing mode on the RD Session Host server using the following command: PS RDS:RDSConfigurationLicensingSettings> Set-Item .LicensingType -Value [Type] where, the possible values of [Type] are: 2 - Per Device 4 - Per User b. In the Specified License Server list, add the license server name by using the following command: PS RDS:RDSConfigurationLicensingSettingsSpecifiedLicenseServers> New-Item -Name [LSName] where [LSName] refers to the name of the license server.
For more information about licensing and Windows PowerShell, use these commands: cd , dir , and Get-Help .
Published Sep 08, 2018
Version 1.0MicrosoftSecurityandComplianceTeam
Iron Contributor
Joined September 05, 2018
Microsoft Security Blog
Follow this blog board to get notified when there's new activity