Sign in to follow this  
Followers 0
mohammadezazi

Pass Password to RemoteDesktop session

6 posts in this topic

#1 ·  Posted (edited)

Hi

I've wrote a script to logon remote on my servers.

I want to send the password also to server. so the logon must be done automatically.

I've used this code: 

$oRDP = ObjCreate("MsTscAx.MsTscAx")
   GUICreate($SerName, @DesktopWidth-50, @DesktopHeight-70)
   $GUIActiveX = GUICtrlCreateObj($oRDP, 5, 5, @DesktopWidth-60, @DesktopHeight-80)

   GUISetState()

   $oRDP.Server = $SerName
   $oRDP.UserName = $UserName
   
   $oRDP.Connect()

   While 1
      $msg = GUIGetMsg()
      Select
         Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
         EndSelect  
   WEnd
   GUIDelete()

Please help me to send password also.

I couln't find solution for my problem in this forum

There are several softwares that can send password. such "RemoteDesktop Manager", ... .  But I want to do it by Autoit.

Edited by mohammadezazi

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Not sure it is possible... ... in fact, really possible !

You can still temporarily add the credential to the credential manager (using Cmdkey.exe or WinApi CredWrite function), juste before the connection, and delete it after.

It's not really clean, but can work.

Edited by jguinch

Share this post


Link to post
Share on other sites

Please help me to send password also.

 

Try adding this line (it works for me):

$oRDP.AdvancedSettings2.ClearTextPassword = $Password

Cheers,

sahsanu

Share this post


Link to post
Share on other sites

Tnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

It works wery nice.........

:*

Thank you againnnnnnnnnnnnnn

Share this post


Link to post
Share on other sites

Tnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

It works wery nice.........

:*

Thank you againnnnnnnnnnnnnn

 

You are welcome ;)

Share this post


Link to post
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
Sign in to follow this  
Followers 0