Jump to content

Remote Desktop with selected user batch file


studmuffinbob

Recommended Posts

I have been searching and searching for a batch file or script that I can run at startup or runonce that will enable Remote Desktop and also add only a specific user/group that will have the remote desktop ability, so if anyone has some info on this matter I would greatly appreciate it.

V/R,

Studmuffinbob

Link to comment
Share on other sites


What you first should look for is the registry changes required to enable remote desktop.

Put them into a .reg file.

Then look up how to apply a .reg file via a batch file.

Both are quite easy to lookup on google.

Link to comment
Share on other sites

Enable remote desktop:

strComputer = "."
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")set colItems = objWMI.ExecQuery("Select * from Win32_TerminalServiceSetting")

for each objItem in colItems
intRC = objItem.SetAllowTSConnections(true)
if intRC then
WScript.Echo "Error enabling Remote Desktop"
end if
next

You don't say if you want to add a local user/group or and AD user/group which is slightly different.

Don't forget to turn on the firewall exception for remote desktop also. And make sure that the No exceptions allowed box is not checked.

Link to comment
Share on other sites

If you are using an unattended install file you can add the following to it

[TerminalServices]

AllowConnections=1

If your using a Active Directory domain you can make a group policy that specifies each user or group that is allowed.

Edited by pierce14u2
Link to comment
Share on other sites

I am using Active Directory domain, and I only want one group to be able to remote into the machines. I am also trying to make this work with an Unattended Windows server 2003 installation. Thank you for all the responses I really appreciate it.

V/R,

Studmuffinbob

Link to comment
Share on other sites

the easiest way then would likely be to use the net command.

net localgroup "Remote Desktop Users" "domain\My TS Users" /add

replace domain with your domain name and "my ts users" to your group name.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...