The Core of VDI Infrastructure
In a traditional office, every employee gets a physical desktop tower. In a modern enterprise, employees are given cheap, low-power thin clients (or they use their own personal laptops from home) to connect remotely to a massive, centralized server in the data center. That central server handles all the processing, RAM, and application execution.
This architecture is known as Virtual Desktop Infrastructure (VDI). To build this in a Microsoft environment, you must transform a standard Windows Server into a Remote Desktop Session Host (RDSH). Once configured, the server can accept dozens or even hundreds of simultaneous remote desktop connections from employees, providing each user with their own isolated desktop session on the same physical hardware.
While you can click through the Server Manager wizard to deploy RDS, using PowerShell allows you to rapidly provision RDSH servers in an automated, scalable fashion.
Step 1: Installing the Core Role Services
Remote Desktop Services is not a single feature; it is a suite of roles. For a basic deployment, you need three specific roles installed on the server: the Session Host itself, the Connection Broker (which routes users to their sessions), and the Licensing module.
Open PowerShell as an Administrator and execute the following deployment command. Replace the server name with your machine’s actual FQDN (Fully Qualified Domain Name).
New-RDSessionDeployment -ConnectionBroker "VDI-SERVER-01.corp.com" -WebAccessServer "VDI-SERVER-01.corp.com" -SessionHost "VDI-SERVER-01.corp.com"
PowerShell will install the necessary binaries, configure the internal IIS web server for remote access, and automatically restart the server. Note: Your PowerShell session will disconnect during the reboot.
Step 2: Creating the Session Collection
Once the server reboots, the roles are installed, but the server is not yet actively accepting connections. You must create a “Session Collection.” A collection is a logical grouping of servers and users (e.g., a “Finance Collection” vs. an “Engineering Collection”).
Log back into the server, open PowerShell, and run:
New-RDSessionCollection -CollectionName "CorporateDesktop" -SessionHost "VDI-SERVER-01.corp.com" -ConnectionBroker "VDI-SERVER-01.corp.com" -CollectionDescription "Standard Employee Remote Desktop"
This command binds the host server to a specific collection.
Step 3: Assigning User Permissions
By default, no one is allowed to connect to your new collection. You must authorize specific Active Directory security groups.
If you want all standard employees (members of the “Domain Users” group) to have access, execute:
Set-RDSessionCollectionConfiguration -CollectionName "CorporateDesktop" -UserGroup "CORP\Domain Users" -ConnectionBroker "VDI-SERVER-01.corp.com"
Step 4: Configuring Session Timeouts
The biggest risk to an RDSH server is resource exhaustion. If an employee connects on Friday, opens 50 Chrome tabs, and then simply disconnects (closing the window without clicking “Sign Out”), their session remains active in the server’s RAM all weekend.
You must configure aggressive session timeouts to reclaim memory.
Set-RDSessionCollectionConfiguration -CollectionName "CorporateDesktop" -DisconnectedSessionLimitMin 120 -IdleSessionLimitMin 120 -ActiveSessionLimitMin 0 -ConnectionBroker "VDI-SERVER-01.corp.com"
With this command, if an employee simply disconnects (or goes completely idle for two hours), the RDSH server will forcefully terminate their session, saving any open files to their roaming profile and instantly freeing up CPU and RAM for other active users. The server is now fully secured, optimized, and ready for production load.