Skip to content

Instantly share code, notes, and snippets.

@nironkoren
Forked from jdforsythe/connect.ps1
Created July 16, 2017 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nironkoren/998392e33761673b78258ee5bc2a3ad3 to your computer and use it in GitHub Desktop.
Save nironkoren/998392e33761673b78258ee5bc2a3ad3 to your computer and use it in GitHub Desktop.
Remote Desktop Auto Login Powershell Script
echo "Connecting to 192.168.1.100"
$Server="192.168.1.100"
$User="Administrator"
$Password="AdminPassword"
cmdkey /generic:TERMSRV/$Server /user:$User /pass:$Password
mstsc /v:$Server
# https://technet.microsoft.com/library/hh847748.aspx
# Run PowerShell as Administrator
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment