Petri.co.il forums by Daniel Petri  

Petri.co.il forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri.co.il forums by Daniel Petri > Operating Systems > Terminal Services
Petri.co.il is happy to award L4ndy the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri.co.il forums by Daniel Petri Search Today's Posts Mark Forums Read

Notices

IDEALSTOR
Automatically create RDP file with password

Automatically create RDP file with password

this thread has 5 replies and has been viewed 7500 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25th June 2008, 17:49
JeremyW's Avatar
JeremyW JeremyW is offline
Moderator
 
 Join Date: May 2006
  6 month star 12 month star
 Location: Washington DC metro area
 Posts: 2,875
 Reputation: JeremyW is just really niceJeremyW is just really niceJeremyW is just really niceJeremyW is just really niceJeremyW is just really nice (401)
Default Automatically create RDP file with password

Recently I had a need to distribute an RDP file to several users that, when they use it, would log them on without prompting for username and password. We all know that it is possible to save an RDP file with the password in it but the problem is when you move it between users or computers the password doesn't work.

Info on why can be found here http://www.remkoweijnen.nl/blog/2007...are-encrypted/

The above link also provides code for converting a password string into the encrypted password. After a crash course in VB.NET I was able to write a utility that will hash a password properly for an RDP file.

So with this utility I'm able to dynamically create an RDP file with the password in it and deploy the script to whoever needs it.

Giving credit where it's due. The VB.NET example from here was the base and with a few tweaks from the comments in the first link I was able to get a working utility.

Usage for the utility:
Code:
cryptRDP5.exe password
Here's an example batch (I named it LTD2.cmd but you can change that) that I used as a logon script. (the password argument was passed by the GPO)
Code:
:: Usage:
:: LTD2.cmd password
::
:: Variables:
:: "hashtool"   - location of the hash tool
:: "outputfile" - destination and name for the .rdp file
:: "comp"       - computer name (can be FQDN or NetBIOS)
:: "domain"     - name of authenticating domain 
::                  (if stand-alone enter computer name)
:: "usr"        - Username
@echo Off

If "%1"=="" Goto EOF

set pwd=%1
Set hashtool="%ProgramFiles%\CryptRDP\cryptRDP5.exe"
set outputfile="%userprofile%\desktop\computerA.rdp"
set comp=ComputerA
set domain=jeremyw
set usr=imuser

for /f "tokens=*" %%a in ('%hashtool% %pwd%') do set pwdhash=%%a


:CreateRDP
If EXIST %outputfile% del %outputfile%
Echo screen mode id:i:2>> %outputfile%
Echo desktopwidth:i:1024>> %outputfile%
Echo desktopheight:i:768>> %outputfile%
Echo session bpp:i:24>> %outputfile%
Echo winposstr:s:0,1,32,68,800,572>> %outputfile%
Echo full address:s:%comp%>> %outputfile%
Echo compression:i:1>> %outputfile%
Echo keyboardhook:i:2>> %outputfile%
Echo audiomode:i:2>> %outputfile%
Echo redirectdrives:i:0>> %outputfile%
Echo redirectprinters:i:0>> %outputfile%
Echo redirectcomports:i:0>> %outputfile%
Echo redirectsmartcards:i:1>> %outputfile%
Echo displayconnectionbar:i:1>> %outputfile%
Echo autoreconnection enabled:i:1>> %outputfile%
Echo authentication level:i:0>> %outputfile%
Echo username:s:%usr%>> %outputfile%
Echo domain:s:%domain%>> %outputfile%
Echo alternate shell:s:>> %outputfile%
Echo shell working directory:s:>> %outputfile%
Echo password 51:b:%pwdhash%>> %outputfile%
Echo disable wallpaper:i:1>> %outputfile%
Echo disable full window drag:i:0>> %outputfile%
Echo disable menu anims:i:0>> %outputfile%
Echo disable themes:i:0>> %outputfile%
Echo disable cursor setting:i:0>> %outputfile%
Echo bitmapcachepersistenable:i:1>> %outputfile%

:EOF
Hope you find it useful!
Attached Files
File Type: zip cryptRDP5.zip (6.4 KB, 1353 views)
__________________
Regards,
Jeremy

"He is no fool who gives what he cannot keep to gain what he cannot lose" - Jim Elliot

Systems Consultant
Baltimore - Washington area and beyond
www.gma-cpa.com

Last edited by JeremyW; 25th June 2008 at 17:52..
  #2  
Old 25th June 2008, 18:21
AndyJG247's Avatar
AndyJG247 AndyJG247 is offline
Moderator
 
 Join Date: Mar 2008
  6 month star 12 month star
 Location: London
 Posts: 3,677
  Send a message via MSN to AndyJG247
 Reputation: AndyJG247 is a jewel in the roughAndyJG247 is a jewel in the roughAndyJG247 is a jewel in the roughAndyJG247 is a jewel in the rough (310)
Default Re: Automatically create RDP file with password

Thanks! Will have to give this a go tomorrow
__________________
cheers
Andy
MCSE 2003, MCSA:Messaging, CCNA, ITIL
MCITP:Exchange 2007

Exchange / Enterprise Vault / Sharepoint
http://www.bluesource.co.uk

Please read this before you post:
http://support.microsoft.com/kb/555375

Quis custodiet ipsos custodes?
  #3  
Old 25th June 2008, 18:32
JeremyW's Avatar
JeremyW JeremyW is offline
Moderator
 
 Join Date: May 2006
  6 month star 12 month star
 Location: Washington DC metro area
 Posts: 2,875
 Reputation: JeremyW is just really niceJeremyW is just really niceJeremyW is just really niceJeremyW is just really niceJeremyW is just really nice (401)
Default Re: Automatically create RDP file with password

Let me know how it goes and if you have any questions.
__________________
Regards,
Jeremy

"He is no fool who gives what he cannot keep to gain what he cannot lose" - Jim Elliot

Systems Consultant
Baltimore - Washington area and beyond
www.gma-cpa.com
  #4  
Old 15th October 2008, 01:09
robertcgs robertcgs is offline
Casual
Casual
 
 Join Date: Oct 2008
  6 month star 12 month star
 Location: Seattle
 Posts: 1
 Reputation: robertcgs is on a distinguished road (10)
Default Re: Automatically create RDP file with password

Could you revisit the post "automatically create RDP file with Password"? Do I need to install CryptRDP5?

Do you have a working sample of what you actually created? Yes I saw your sample but it mentioned "hashtool" and i can only assume I must install CryptRDP.



You posted this back in July 2008 so I can understand if it takes a while to recall this.

Thanks

Last edited by robertcgs; 15th October 2008 at 01:11..
  #5  
Old 15th October 2008, 01:38
JeremyW's Avatar
JeremyW JeremyW is offline
Moderator
 
 Join Date: May 2006
  6 month star 12 month star
 Location: Washington DC metro area
 Posts: 2,875
 Reputation: JeremyW is just really niceJeremyW is just really niceJeremyW is just really niceJeremyW is just really niceJeremyW is just really nice (401)
Default Re: Automatically create RDP file with password

Hi robertcgs. Welcome to the forums.

Yes, the script requires the CryptRDP5 file. (the name is arbitrary but the file itself is what matters) Install CryptRDP5 is a bit of an overstatement as all you need to do is copy the file to wherever you want on your computer. There is a zipped copy of CryptRDP5.exe attached to my first post that you can use.

The script is the example of using the tool I created (er... put together) and it is almost exactly what I used for a client of mine.

Let me know if that doesn't clear things up for you.
__________________
Regards,
Jeremy

"He is no fool who gives what he cannot keep to gain what he cannot lose" - Jim Elliot

Systems Consultant
Baltimore - Washington area and beyond
www.gma-cpa.com
  #6  
Old 30th October 2008, 11:57
m80arm's Avatar
m80arm m80arm is offline
Moderator
 
 Join Date: Apr 2005
  6 month star 12 month star
 Location: Newcastle, UK
 Posts: 2,582
  Send a message via MSN to m80arm
 Reputation: m80arm is just really nicem80arm is just really nicem80arm is just really nicem80arm is just really nice (351)
Default Re: Electrical Equipment

Quote:
Originally Posted by hkalilinks View Post
Electrical Equipment & Supplies Product From China Electrical Equipment & Supplies manufacturers, suppliers and exporters. All Electrical Equipment & Supplies made in China & Global. Full products catalogs and descriptions. Right here to source products with Chinese brand names. Searching for OEM, ODM & contract manufacturing services.
Spam reported to MODS

Michael
__________________
Michael Armstrong
MCITP: EA, MCTS, MCSE 2003, MCSA 2003: Messaging, CCA, VCP, ITIL, MCP, PGP Certified Technician

** Remember to give credit where credit is due and leave reputation points To grant some reputation points to the user that helped you, just click on the little Yin-Yang icon on the right of the user's answer and follow the prompt. where appropriate **
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically create user’s folder and shares khangee78 Windows 2000 Server, Windows Server 2003 4 24th July 2008 23:24
File Create User is not the owner of the file chbardt Windows 2000 Server, Windows Server 2003 2 10th December 2007 21:22
Create a new Protocol definition for RDP in Cisco ASA5510 JDMils Cisco Routers & Switches How-to 6 18th April 2007 13:01
Is there a way to email a zip file each day automatically to another (outlook 2000) Bud Strange Office XP/2003 General Issues 2 13th July 2006 02:07
Save password in RDP zivw Misc 0 20th July 2005 19:00



All times are GMT +3. The time now is 02:58.

Steel Blue Style vBulletin Style ©2006 vBEnhanced Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri