I am trying to automate to RDP a computer and start a program. I am trying it with WASP from www codeplex
Ideally my aim is to -
RDP to a server and Click OK to Legal Notice window
Click on start menu > Run > Enter key
Type a command in run prompt and then send enter key
Here Stuck in sending keys to RDP session. Can anyone help me to make it work? If it’s not possible via PowerShell then what are my other options?
This is what I have so far..
$process = Start-Process -FilePath mstsc -PassThru
Start-Sleep -Seconds 2
$mstsc = Select-Window | Where-Object { $_.ProcessID -eq $process.Id }
$mstsc | Send-Keys Server.domain.com~
#Sleep to enter password
Sleep -Seconds 15
#Send enter key fails here
$mstsc | Send-Keys ~