RDP sessions with PowerShell

Costas

Administrator
Staff member
Windows PowerShell ISE editor - http://www.powertheshell.com/


the script itself from commandline :
http://irisclasson.com/2015/12/03/saving-rdp-sessions-with-posh/


make script, scriptfile :
-at windows explorer create a new file yourname.ps1
-edit yourname.ps1
JavaScript:
$target = "ThePC" #use computer name or IP

$pdw = "12345"
 
$logon = "administrator"
 
cmdkey /generic:$target /user:$logon #/pass:$pwd
 
cmdkey /list
 
mstsc /v:$target

now, when left-click
Snap437.png



execute the script by PowerShell
snap448.png


You can run a script via :
snap449.png

JavaScript:
<!--
http://windowsitpro.com/powershell/running-powershell-scripts-easy-1-2-3
http://ss64.com/ps/syntax-run.html
 -->
<!-- first enable -->
Set-ExecutionPolicy RemoteSigned

<!--then execute your script -->
script.ps1

The Modules Directory, By Default exists at :
JavaScript:
C:\Windows\System32\WindowsPowerShell\v1.0\Modules
 
 

 
 


Why PowerShell?
https://ramblingcookiemonster.wordpress.com/2013/12/07/why-powershell/


PowerShell Resources
http://ramblingcookiemonster.github.io/Pages/PowerShellResources.html


PowerShellJS
https://github.com/klumsy/PowerShellJS


Set of commands to install PowerShell modules from local file or from the web.
http://psget.net/
https://github.com/psget/psget/
 
Top