Link to home
Start Free TrialLog in
Avatar of Nirmal Sharma
Nirmal SharmaFlag for United States of America

asked on

Set Terminal Services Permissions via Command line

Is there any command line tool available to set permissions on terminal services for Windows 2000?

RDP > Permissions in Terminal Services Configuration?
Avatar of Michael Pfister
Michael Pfister
Flag of Germany image

A simple way (WMI) is available with Windows 2003. For Windows 2000 you must modify the registry. How to do it and a sample app is here:

http://support.microsoft.com/kb/259129/en-us

Hope it helps,

Michael

Avatar of Nirmal Sharma

ASKER

Which registry to modify for windows 2000?
The registry key and its settings are documented in the KB article I've linked. http://support.microsoft.com/kb/259129/en-us

"MORE INFORMATION
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

The security descriptor is stored in self-relative format in the registry. To obtain or modify the security descriptor, you must convert it to absolute format. After you modify the security descriptor, you must convert it back to self-relative format, and then resave the change.

The default security settings are stored in the DefaultSecurity registry value under the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations
If you modify the security settings, they are stored in the Security value under the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
If you modify the default security descriptor and the Security value does not exist under the RDP-Tcp key, you must create the value."

But how to modify them...

Do you think just modifying the value in the entry will make changes?
Sorry, I don't have a Win 2000 machine around to try ...
If you change the permissions via GUI it should be reflected in the registry. This may provide an example how to set it.
But what if I need to set it on more than 400 servers?
If you determine the settings on one machine you can create a script to add the required keys to the rest of the servers.

Registry keys doesn't work. I had tried to import registry keys but it doesn't refresh the registry. Only Add Group/User > and then Click Ok and Apply works great.

However, I have found the TsConSec.exe to set permissions on RDP-TCP. This exe sets the permissions on Windows 2000 RDP-TCP connection but it doesn't work either. Only removing and re-adding group/user works.

So this

TSConSec.exe /t:RDP /a:Users /p /Q

Doesn't work? What group do you want to add?

Have you used the one from this page? http://www.thincomputing.net/download.php?list.6

I'm still looking for a W2K machine to test...
Above command doesn't work actually.

When you see the property of RDP-TCP the group or user is added but it doesn't work. I mean when I try to connect using user in the group it still says: "You don't have access to logon to this session".

And then I go to property of RDP-TCP connection > Permissions Tab > Remove the Group/user from here > Re-add the group/user > Click on OK and then Apply and it works!!!

I don't know why it doesn't work using TsConSec.exe
Hm, maybe when applying the rights via mmc it "informs" the terminal services about the change. When done via TsConSec it doesn't. Have you tried to restart after applying the settings with TSConSec?
Restart is not a good option...

Any service can be restarted?
I'd guess "Terminal Services" is a good candiate.
Can you restart Terminal Services service?

Is it possible?
ASKER CERTIFIED SOLUTION
Avatar of Michael Pfister
Michael Pfister
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points. Were you able to test it on a machine if a reboot helps?