• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 90
  • Last Modified:

Powershell: use logged on credentials to logon to RDP?

Hi,

Is there a way to pass credentials with which I'm logged on to my Windows system to an RDP session (mostly Windows 7/2012)?
So that would be  mstsc /admin /v:$computername
then using  @runas /user:$env:USERDOMAIN\$env:USERNAME  with cachedcredentials.

Please advise.
J.
0
janhoedt
Asked:
janhoedt
  • 2
1 Solution
 
NEnterprise Systems EngineerCommented:
Hello,

I was looking for something very similar yesterday and found the following:

https://stackoverflow.com/questions/3917779/get-current-users-credentials-object-in-powershell-without-prompting

While not the same scenario as yourself it certainly implies that you can't pass the cached credentials.  I'm no expert on powershell though so happy to stand corrected!
0
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
To set things up so that a domain user can log on to internal Remote Desktop Services Session Hosts and RemoteApp services Single-Sign On needs to be set up in Group Policy.

Once that's done then any connection to an RDS setup would automagically log the user in.

This should apply for a Virtual Desktop Infrastructure (VDI) setup with desktop operating systems served via RDS.
0
 
janhoedtAuthor Commented:
what gpo to set/use?
0
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now