Hello,
We are in the process of setting up the connection to the servers via RDP. We are experiencing a problem when trying to connect. PasswordStats changes username to hostname\username.
After analyzing the PSLaucher.ps1 file I found the block that was causing the problem.
How can we deactivate it, knowing that every time I modify this file the RDP session no longer starts?
if($UserName -like '*.\*' -or $AccountType -eq 'Windows')
{
#User account in this space is a local Windows Account, and is not supported to work with a Remote Desktop Gateway. Therefore, no need to set a Windows Credential for this type of account
$NewUserName = $HostName + '\' + $UserName.replace('.\', '')
#add generic credential (TERMSRV)
cmdkey /generic:TERMSRV/$HostName /user:$NewUserName /pass:"""$Password"""
}
else
{
#In this block, we are using a domain account, so if user is passing Remote Gateway commands to the session, we will add a Windows Credential **Gateway requires a Windows Credential to be passed, not a TERMSRV (generic) credential**
if ($rdGatewayAddr) #this IF statement checks the variable has any value other then null
{
#add Windows Credential
cmdkey /add:$rdGatewayAddr /user:$UserName /pass:"""$Password"""
}
#add generic credential (TERMSRV)
cmdkey /generic:TERMSRV/$HostName /user:$UserName /pass:"""$Password"""
}
Thanks