RDS 2012: How to login to RDWeb page without typing Domain Name?

Logon to RDWeb site with just username and password, saves time and confusion for the users. We can make user to bypass typing Domain Name with few easy steps.

There is two steps I did. One add “DomainName\” by script and second steps to change the text from “Domain Name\User name:” to just “User name:” in logon page.

To do the first step, follow the instructions below.

For Windows 2012 R2:

1. Remote Desktop to your RD Web Access Server.

2. Open Windows Explorer and go to C:\Windows\Web\RDWeb\Pages. Backup webscripts-domain.js file.

3. Open Notepad as (run as) Administrator. Open C:\Windows\Web\RDWeb\Pages\webscripts-domain.js

4. Find strDomainName variable text. It looks like this:

var strDomainName = “”;

5. Modify the above text with your NetBIOS domain name like below: (CONTOSO is my example domain, replace it with yours).

var strDomainName = “CONTOSO”;

6. Save the file and close the Notepad.

For Windows 2012:

1. Remote Desktop to your RD Web Access Server.

2. Open Windows Explorer and go to C:\Windows\Web\RDWeb\Pages. Backup renderscripts.js file.

3. Open Notepad as (run as) Administrator. Open C:\Windows\Web\RDWeb\Pages\renderscripts.js

4. Find “strDomainUserName = objForm.elements(“DomainUserName”).value;” and add the following script blob

// add default domain…
if ( strDomainUserName.indexOf(“\\”) == -1 )
{
strDomainUserName = “INTSURG\\” + strDomainUserName;
objForm.elements(“DomainUserName”).value = strDomainUserName;
}

So it would look like this..

if ( objForm != null )
{
strDomainUserName = objForm.elements(“DomainUserName”).value;
// add default domain…
if ( strDomainUserName.indexOf(“\\”) == -1 )
{
strDomainUserName = “MYDOMAIN\\” + strDomainUserName;
objForm.elements(“DomainUserName”).value = strDomainUserName;
}
strPassword = objForm.elements(“UserPass”).value;
strWorkspaceId = objForm.elements(“WorkSpaceID”).value;

 

5. Save renderscripts.js file.

Now user can just provide username and password. Domain name will be added if it is not present.

Now it the RD Web access log on page will still display Domain Name\User name:. That can be changed very easily also. Follow the steps below for the second step.

For Windows Server 2012 and Windows Server 2012 R2:

1. Remote Desktop to your RD Web Access Server.

2. Open Windows Explorer and go to C:\Windows\Web\RDWeb\Pages\en-US. Backup login.aspx file.

3. Open Notepad as (run as) Administrator. Open C:\Windows\Web\RDWeb\Pages\login.aspx

4. Modify the following text as below:

Before:

const string L_DomainUserNameLabel_Text = “Domain\\user name:”;

After:

const string L_DomainUserNameLabel_Text = “User name:”;

5. Save login.aspx file.

image

That’s all. If you ever update with RDS patches, you will have to redo these steps again.