Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# Install RDS and other services and tools
PS C:\Users\serverworld> Install-WindowsFeature Remote-Desktop-Services,RDS-Web-Access,RDS-RD-Server,RDS-Connection-Broker,RDS-Licensing -IncludeManagementTools
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True Yes SuccessRest... {ASP.NET 4.8, Remote Desktop Connection Br...
WARNING: You must restart this server to finish the installation process.
# restart computer to apply changes
PS C:\Users\serverworld> Restart-Computer -Force
# enable PowerShell remote connection
PS C:\Users\serverworld> Enable-PSRemoting
# configure ConnectionBroker/WebAccessServer/SessionHostServer
# specify Server's hostname or IP address for each value
PS C:\Users\serverworld> New-RDSessionDeployment -ConnectionBroker "rx-7.srv.world" -WebAccessServer "rx-7.srv.world" -SessionHost "rx-7.srv.world"
# confirm settings
PS C:\Users\serverworld> Get-RDServer
Server Roles
------ -----
RX-7.SRV.WORLD {RDS-RD-SERVER, RDS-CONNECTION-BROKER, RDS-WEB-ACCESS}
# SSL certificate for remote accessing is generated automatically by the installation steps,
# however, it can not access with the generated certificate because ERR_SSL_KEY_USAGE_INCOMPATIBLE error is shown,
# so remove it and set a valid certificate you got or set a self-signed certificate created by yourself.
# it uses self-signed certificate on this example.
# show current configured certificate
PS C:\Users\serverworld> Get-ChildItem "Cert:\LocalMachine\My"
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\My
Thumbprint Subject
---------- -------
10563F49DE58B36FBBF442225D1A91DFC852B9A8 CN=rx-7.srv.world
# remove the auto-generated certificate
PS C:\Users\serverworld> Remove-Item "Cert:\LocalMachine\My\10563F49DE58B36FBBF442225D1A91DFC852B9A8"
# get certificate or create self-signed certificate ⇒ refer to here for creating self-signed certificate
# show new configured certificate
PS C:\Users\serverworld> Get-ChildItem Cert:\LocalMachine\My
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\My
Thumbprint Subject
---------- -------
9E552FBAABB34542EF42AF6399A797F42993D098 CN=rx-7.srv.world
# set a new certificate to the IIS for RDWeb site (Default Web Site)
PS C:\Users\serverworld> $Cert = Get-ChildItem Cert:\LocalMachine\My\9E552FBAABB34542EF42AF6399A797F42993D098
PS C:\Users\serverworld> Get-Website
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
Default Web Site 1 Started %SystemDrive%\inetpub\wwwroot http *:80:
https *:443: sslFlags=0
PS C:\Users\serverworld> Set-Item IIS:\SslBindings\0.0.0.0!443 -Value $Cert
|