RPD session without credential prompt in GUI

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
CitrixITM
Posts: 123
Joined: Tue Mar 01, 2016 8:28 am

RPD session without credential prompt in GUI

Post by CitrixITM » Wed Nov 08, 2017 8:00 am

Hello,

My goal is to launch an RDP session without being prompted for credentials. Below is a function that works fine if executed form a Powershell windows, but when I try to call it from within a GUI, I get prompted for credentials. Any ideas?


function Get-MSTSC
{
[CmdletBinding()]
param ()

$deploy = {
Param ($VMPublicIP,
$AzureUsername,
$AzurePasswordUnsecure)
cmdkey /delete:$VMPublicIP
cmdkey /generic:TERMSRV/$VMPublicIP /user:$AzureUsername /pass:$AzurePasswordUnsecure
mstsc /v:$VMPublicIP
}
Start-Job -name $VM-$VMPublicIP -ScriptBlock $deploy -ArgumentList $VMPublicIP, $AzureUsername, $AzurePasswordUnsecure
}

User avatar
jvierra
Posts: 12086
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: RPD session without credential prompt in GUI

Post by jvierra » Wed Nov 08, 2017 8:14 am

mstsc /?

This will show you how to specify connection. Credentials will have to be saved in vault. You can also specify a saved RDP connection file.

User avatar
CitrixITM
Posts: 123
Joined: Tue Mar 01, 2016 8:28 am

Re: RPD session without credential prompt in GUI

Post by CitrixITM » Wed Nov 08, 2017 8:32 am

It's my understanding that the ability to enter in the username and password directly into MSTSC has been removed. That is why people are looking for workarounds. Any ideas how I could modify my code to work inside of the GUI the way it works outside the GUI?

Thank you,
Brian

User avatar
jvierra
Posts: 12086
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: RPD session without credential prompt in GUI

Post by jvierra » Wed Nov 08, 2017 8:39 am

Specify a file and be sure the credentials are stored for the file. That is the replacement.

User avatar
jvierra
Posts: 12086
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: RPD session without credential prompt in GUI

Post by jvierra » Wed Nov 08, 2017 8:41 am

Here is my auto file. It does not ask for credentials.

mstsc omega.rdp

User avatar
CitrixITM
Posts: 123
Joined: Tue Mar 01, 2016 8:28 am

Re: RPD session without credential prompt in GUI

Post by CitrixITM » Wed Nov 08, 2017 8:54 am

I don't see a way to download/view the mstsc omega.rdp file and how would I auto-generate that file?
Also, any idea why my previous function works fine unless executed form the GUI? Perhaps something is happening in a different session?

Thank you,
Brian

User avatar
CitrixITM
Posts: 123
Joined: Tue Mar 01, 2016 8:28 am

Re: RPD session without credential prompt in GUI

Post by CitrixITM » Wed Nov 08, 2017 2:00 pm

This has been resolved. The issue was that I needed a GPO to allow delegating saved credentials with NTML-only server authentication.

Thanks,
Brian

User avatar
jvierra
Posts: 12086
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: RPD session without credential prompt in GUI

Post by jvierra » Wed Nov 08, 2017 2:13 pm

Omega.rdp is a file for my connection. MSTSC can create one very easily. Type mstsc and create a connection then save it to a file.

Setting NTLM delegation on a server can be a security risk.

Locked