Is there a PowerShell Command that can change the gpedit setting to Restrict Remote Desktop users to a single session?

0

I have to set up servers often, and am developing a base setup script to configure our group's most standard practices.

We often have to enable more than one session for a remote user. So what I'm wondering is if I can script disabling the policy "Restrict Remote Desktop Services users to a single Remote Desktop Services session" Found in

gpedit.msc -> Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Sessions Host -> Connections.

Axeman

Posted 2015-10-07T14:42:59.223

Reputation: 149

Answers

4

Most GP settings are simply registry entries/changes.

Microsoft offers documentation that tells you which Registry setting aligns to which Group Policy:

Group Policy Settings Reference for Windows and Windows Server

Looking in the Windows Server 2012 R2 document, it shows that

HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services!fSingleSessionPerUser

Is the registry entry that holds the data you are looking to set.

You can change the registry with Powershell by using its standard registry handling commandlets.

More info on that: Weekend Scripter: Use PowerShell to Easily Modify Registry Property Values

Ƭᴇcʜιᴇ007

Posted 2015-10-07T14:42:59.223

Reputation: 103 763

Cool thanks, because I looked at fSingleSessionPerUser according to some other sources and it was set, while the gpedit setting disabled. But I did not look in HKLM:\SOFTWARE\\Policies. When I looked under that branch, fSingleSessionPerUser is off. – Axeman – 2015-10-07T15:15:13.007