From 991af041fff4bde8b37a2a39bddd701c40d10020 Mon Sep 17 00:00:00 2001 From: Vineet Kumar Date: Wed, 9 Oct 2019 11:16:33 -0600 Subject: [PATCH 1/2] Added Powerhsell script to take Remote Desktop of PC which will helpful in automating some task related to mstsc --- Powershell/TakeRemote.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Powershell/TakeRemote.ps1 diff --git a/Powershell/TakeRemote.ps1 b/Powershell/TakeRemote.ps1 new file mode 100644 index 0000000..a8f4806 --- /dev/null +++ b/Powershell/TakeRemote.ps1 @@ -0,0 +1,7 @@ +#This script take remote desktop of PC whose hostname is passed. +#To run this script open powershell and navigate to script location folderand type following way:: +#.\TakeRemote.ps1 "Hostname" "Password" "UserName" +param([String]$HostName,[String]$Password,[string]$User) +cmdkey /generic:TERMSRV/$HostName /user:$User /pass:$Password +mstsc /v:$HostName +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned From 150ccb8f9e2a740de8de0f1d5ea7025349a36fe7 Mon Sep 17 00:00:00 2001 From: Vineet Kumar Date: Wed, 9 Oct 2019 12:34:02 -0600 Subject: [PATCH 2/2] take remote of PC --- Powershell/TakeRemote.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powershell/TakeRemote.ps1 b/Powershell/TakeRemote.ps1 index a8f4806..da06456 100644 --- a/Powershell/TakeRemote.ps1 +++ b/Powershell/TakeRemote.ps1 @@ -1,6 +1,6 @@ #This script take remote desktop of PC whose hostname is passed. #To run this script open powershell and navigate to script location folderand type following way:: -#.\TakeRemote.ps1 "Hostname" "Password" "UserName" +#.\TakeRemote.ps1 "Hostname" "Password" "UserName." param([String]$HostName,[String]$Password,[string]$User) cmdkey /generic:TERMSRV/$HostName /user:$User /pass:$Password mstsc /v:$HostName