Server 2012 R2 RDWeb - Setting default domain for computer connections (NOT RDWeb first login)

Hi Everyone,

I am looking to set the default domain for logins using the "Connect to a Remote PC" option in RDWeb. I am looking into this because users accessing the remote gateway from home are forced to choose another user and input the "domain\" portion of the username. This is confusing for users not familiar with a domain environment, and I want to streamline the process as much as possible.

I should note that I am NOT trying to skip the domain requirement for first login to RDWeb. I've done this already and it's working fine.

I AM trying to remove the domain requirement (by pre-defining the domain) from the Windows Security prompt, which comes after selecting a computer to connect to in RDWeb. NOTE: I am not using an RDP file via remoteapps, but simply using the connect to a remote PC option in RDWeb.

So far my research has lead me to believe the solution lies with adding a RDP variable such as username:s:<domain>\ or domain:s:<domain>\n to either the renderscripts.js or desktops.aspx files in the RDWeb pages folder. My lack of scripting ability and the seeming lack of resources on the topic have so far left me stumped.

Ross' post from the following article sums up perfectly what I'm trying to do, but unfortunately only for the server 2008 R2 version of RDS. The code he is referencing in renderscripts.js seems to differ from the 2012 version of the file.

https://social.technet.microsoft.com/Forums/windowsserver/en-US/f02bd61f-d6fd-4c05-b17a-deffcc61a4e9/how-to-set-default-logon-domain-rd-gateway-andor-rd-web?forum=winserverTS&prof=required

------------------------------------------

Hi,

Yes the logging in without the domain thing is weird (RDC v6.1) and dangerous (RDC v7.0) as the latter gives an error clicking on the icon presented in the web access applications list (i.e. "Your computer can't connect to the remote computer because an error occured on the remote computer that you want to connect to.").

The solution we employed was to tweak the underlying web files to better handle the domain.  We only have one domain so this was fixed, what I did was edit the renderscripts.js file (which includes the JS procedure which occurs after the login dialog 'submit') to check to see if the user has entered a domain (checking whether a backslash exists) and if not physically edit the edit box contents with the new domain.

In the renderscripts.js file look for the function onLoginFormSubmit(), where it probes the username edit box simply insert the domain.  The code extract below includes a peice from the original file which shows you where it should be placed together with the new code (separated by blank lines).  In this instance the domain is called CHARLYMONKEY.

    if ( objForm != null )
    {
        strDomainUserName = objForm.elements("DomainUserName").value;

        // add default domain...
        if ( strDomainUserName.indexOf("\\") == -1 )
        {
          strDomainUserName = "CHARLYMONKEY\\" + strDomainUserName;
          objForm.elements("DomainUserName").value = strDomainUserName;
        }

        strPassword = objForm.elements("UserPass").value;
        strWorkspaceId = objForm.elements("WorkSpaceID").value;

I hope that is of help, obviously if anything goes wrong with the login the modified version is written back to the edit box (this is essential) so the user can see if somehow they've entered the domain or something but with the wrong kind of slash.

Please note that if you also tweak your main screen to check for RDC 7.0 and if not force users to download and install it the single sign-on works fantastically.  I haven't done this yet but am hoping the RDC ActiveX control can be probed by JavaScript so that proper version checking can take place.

kind regards,

Ross

------------------------------------------

Thanks in advance for any advice!

- Ryan



  • Edited by swiN12 Tuesday, July 21, 2015 4:13 PM
July 21st, 2015 3:41pm

Hi Ryan,

So far my research has lead me to believe the solution lies with adding a RDP variable such as username:s:<domain>\ or domain:s:<domain>\n to either the renderscripts.js or desktops.aspx files in the RDWeb pages folder. My lack of scripting ability and the seeming lack of resources on the topic have so far left me stumped.

Since we are not familiar with Java scripting/.aspx page code customization, I suggest you refer to asp.net forum below to get professional support:

http://forums.asp.net/

Here are some related articles below for you:

Modifying the default RDWebAccess web page for fun and profit
http://blogs.technet.com/b/askperf/archive/2011/01/21/modifying-the-default-rdwebaccess-web-page-for-fun-and-profit.aspx

Customizing RD WebAccess

http://social.technet.microsoft.com/wiki/contents/articles/7263.customizing-rd-webaccess.aspx

Best Regards,

Free Windows Admin Tool Kit Click here and download it now
July 24th, 2015 3:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics