0

I am writing windows power shell script to connect the remote desktop machine. When execute below command in power shell am getting attached notification:

enter image description here

How can we handle this notification or default proceed with "Yes"?

cmdkey /generic:"xx.xxx.xxx.xxx" /user:"test" /pass:"pass" mstsc /v:xx.xxx.xxx.xxxx
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Jack
  • 11
  • 2
  • You could deploy trusted certificates on all the servers... – Mathias R. Jessen Jun 08 '21 at 11:03
  • Any windows powershell command key to accept this certificate ?? – Jack Jun 08 '21 at 11:14
  • Possible duplicate: https://stackoverflow.com/questions/20686361/how-to-ignore-the-certificate-warning-on-remote-desktop-connection and https://stackoverflow.com/questions/52328972/powershell-suppress-certificate-notification – Karolina Ochlik Jun 08 '21 at 12:30

1 Answers1

0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 0 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\LocalDevices" /v "<IP ADDRESS HERE>" /t "REG_DWORD" /d 13 /f

You can delete these entries after connecting

Chand
  • 300
  • 3
  • 13