Remote Desktop


 i want users to click a batch file (registry) to enable remote desktop rather than going to my computer properties , remote deskop , apply ok etc ..........
techpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TomislavjSystem AdminCommented:
0
mgrooverSolution ArchitectCommented:
http://www.technize.com/3-ways-to-enable-remote-desktop-in-windows-vista-and-windows-7/

Section 2.

If you need help with creating a script let me know and I can wiff it together for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
techpAuthor Commented:

 need proper batch file such that it creates automatically by a click
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

mgrooverSolution ArchitectCommented:
Have you got any more background information before I put it together...
What users will be running the script, admin users or standard user?
Are the machines joined to a domain?
0
XpertaCommented:
If the users are not domain or local admins, then they will not be able to change the remote desktop settings by batch file or otherwise.

Why not do it through group policy?
0
techpAuthor Commented:

 users are in domain users /local adminstrators
0
mgrooverSolution ArchitectCommented:
Use the attached VB-script which was found in Tomislavj's post.

You would still need to have the Window Firewall/3rd party firewall configured to allow connections to RDP.

I would recommend using Group Policy to deploy this to the computers if they are joined to a domain.
'
' -------------------------------------------------
' Turns on Remote Desktop setting
'
' NOTE: Does not configure firewall
'

machine = "."
cimv2_string = "WINMGMTS:" & "\\" & machine & "\root\cimv2"
query = "select * from Win32_TerminalServiceSetting"
value_to_set = 1 ' 0=off, 1=on


set cimv2 = GetObject( cimv2_string )
set items = cimv2.ExecQuery( query )

for each item in items

	item.SetAllowTSConnections( value_to_set )

next
' -------------------------------------------------

Open in new window

0
XpertaCommented:
Okay, why not put the user in the builtin Remote Desktop User group in AD.

If that does not work, why not create a computer group policy (or amend an existing one) that adds a domain security group (create a new security group) to the local Remote Desktop Users group.  

Following a gpupdate /force or reboot it should add this new domain security group to the local Remote Desktop Users group on the machine.

Then you can just add the user to this domain security group and they will be able to access remotely.
0
johnb6767Commented:
Just thought I would add this, where I can do it remotely...... Just launch and enter the Remote PCName..... Simple Input Batch..... (Course you need rights to the target PC). PSEXec is also used to remotely add a user to the target's RDP Group..... Can omit that part if needed, otherwise make sure PSExec is in the path or create the folder structure.....


echo off
setlocal

:begin
cls
	set /p WS=Enter Workstation to enable RDP on:  
	echo.

If exist "c:\BatchFiles\psexec.exe" goto GO

cd\
REM Copies PSExec from the network locally if not present.....
md "BatchFiles"
copy \\server\share\psexec.exe "c:\BatchFiles"


:GO
cls
echo Contacting remote machine....
echo.
echo Note the Value below....
echo.
reg query "\\%ws%\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections | find /i "fDenyTSConnections"
if %errorlevel%==1 goto again2
echo.
echo 0x1= RDP is Disabled
echo 0x0= RDP is Enabled
echo.
	set /p prmpt=Do you wish to Enable RDP, Disable RDP or Quit? (e, d or q) :  
	echo.

IF %prmpt%==d GOTO DIS
IF %prmpt%==e GOTO MRG
IF %prmpt%==q GOTO end

:DIS
cls
Echo Modifying Registry...
Echo.
reg add "\\%ws%\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0x1 /f >nul
pause
GOTO user

:MRG
cls
Echo Modifying Registry...
Echo.
reg add "\\%ws%\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0x0 /f >nul
pause
GOTO user

:user
cls
	set /p ASK= Do you wish to add a Remote User on %WS%? (y or n): 

if %ASK%==n goto again
cls
	set /p UID= Enter the UserID to add to Remote Desktop Users Group on %ws%:  
 
REM Change Domain to your domain name.....
"c:\BatchFiles\psexec.exe" \\%WS% net localgroup "Remote Desktop Users" DOMAIN\%UID% /add
cls
	set /p ASK2= Do you wish to open Local Groups on %WS% to verify? (y or n): 

if %ASK2%==n goto again

REM Change Domain to your domain name.....
"C:\WINDOWS\system32\mmc.exe" /s /computer="%ws%.DOMAIN" C:\WINDOWS\system32\lusrmgr.msc

:again
cls
	set /p ASK2=Do you wish to enable another RDP on another workstation (y or n)? 
	echo.

if %ask2%==y goto begin
if %ask2%==n goto end

:again2
cls
echo There was a problem contacting the machine. Please check that it is online.
echo.
pause

goto end

:END
endlocal
echo Goodbye!!

ping -n 5 localhost >nul


exit

Open in new window

0
techpAuthor Commented:

 none of them had given exact answer
 ( i want users to click a batch file (registry) to enable remote desktop rather than going to my computer properties , remote deskop , apply ok etc .)
0
johnb6767Commented:
Thats exactly what I posted.... I use it for remote PC's, but you could easily enter localhost

Here it is in its most simple format....
echo off  
setlocal  
  
:begin  
cls  
        set /p WS=Enter Workstation to enable RDP on:    
        echo.  
  
:MRG  
cls  
Echo Modifying Registry...  
Echo.  
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0x0 /f >nul && echo RDP is now enabled....
echo.
pause
  
:END  
endlocal  
echo Goodbye!!  
  
ping -n 5 localhost >nul  
  
  
exit

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.