PowerShell
#start an remote desktop sessie
function Start-RDPSession {
param([string]$ComputerName=$(Throw "Missing computername argument!!"),
[switch]$Admin)
if ($Admin) {
Invoke-Expression -Command "mstsc.exe /v:$ComputerName /admin"}
else {
Invoke-Expression -Command "mstsc.exe /v:$ComputerName"}
}