Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Unable to Automate RDP Using PowerShell

$
0
0

Hi Team,

I have Azure - Windows Server 2016 VMs that are being used for testing. so i have a requirement where i need to Remote desktop into these machines and run my test. In this process i wanted to automate the whole RDP process.

I checked online for powershell scripting to do that as per below 

$Server   = "AzureVMName"
$User     = "UserName"
$Password = "password"

cmdkey /delete:"$Server"
cmdkey /generic:"$Server" /user:"$user" /pass:"$password"

mstsc /v:"$Server" /admin

But the problem is when i run the above in powershell , still i get the windows pop up for password entry. Once i enter the password manually i get a pop up of certificate acceptance. As i have to run the tests as  a business requirement , i can't even modify the policies to do the changes as per IT security reasons.

So how can i achieve automating the whole RDP process - is there any way using powershell, if not possible can anybody suggest any tool or way of getting this automated withput changing any local security policies.

Regards,

Ranjan


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>