RPD session without credential prompt in GUI

Ask your 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.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
CitrixITM
Posts: 124
Last visit: Wed Jul 27, 2022 2:19 pm

RPD session without credential prompt in GUI

Post by CitrixITM »

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
}
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: RPD session without credential prompt in GUI

Post by jvierra »

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: 124
Last visit: Wed Jul 27, 2022 2:19 pm

Re: RPD session without credential prompt in GUI

Post by CitrixITM »

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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: RPD session without credential prompt in GUI

Post by jvierra »

Specify a file and be sure the credentials are stored for the file. That is the replacement.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: RPD session without credential prompt in GUI

Post by jvierra »

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

mstsc omega.rdp
User avatar
CitrixITM
Posts: 124
Last visit: Wed Jul 27, 2022 2:19 pm

Re: RPD session without credential prompt in GUI

Post by CitrixITM »

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: 124
Last visit: Wed Jul 27, 2022 2:19 pm

Re: RPD session without credential prompt in GUI

Post by CitrixITM »

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

Thanks,
Brian
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: RPD session without credential prompt in GUI

Post by jvierra »

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.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked