The Finer Points of Backslash
Thursday, March 7, 2013 at 9:18PM
Guy Techie
 

The insistence of using backslash to indicate the domain in logins is the bane of our IT existence.  There are many users who put in help desk tickets for login issues simply because of the requirement of the company's domain.  Why can't the domain be forced?  Why can't the user just type their username like any other entity that requires a login?
 
The web-facing Microsoft products we use (Outlook Web Access and Remote Destop Web Access) even insists on "Domain\user name:".  As techies, we are used to this.  Of course, "username@domain" is also a valid login credential.  So why doesn't Microsoft use @domain as the standard login prompt for all things domain?  Instead of asking for "Domain\user name", they could simply say "username@domain:" by default, and give techs an easier way to change it to "Company Email Address:".
 
Of course, real domains would have something like "username@domain.com".  People are used to the @ sign.  They do not know much about the backslash (or \).  Here are some reasons why the backslash shouldn't be used for the general public:
 
 
Mobile devices hide the backslash key several layers deep because it isn't used often in "real life".
As techies, we're used to the backslash because we need to use it to enter login credentials with domains as well as using it for disk paths (\\server\folder\filename.txt or C:\Windows\notepad.exe).  This seems trivial to us.  However, if you have to deploy Outlook Web Access or Remote Desktop Web Access for the "normals", be prepared for a flood of help desk tickets and phone calls.
 
Case Study
The pain that started this rant was actually Windows Server 2008 R2's RD Web Desktop.  After many users flooded our gates with login issues (not reading the email we issued), my boss decided to fix the issue on our side.

It was actually a maddening experience for both users and IT.  RD Web Access allows you to log into the web portal with just your username (sans domain).  However, when you click on any resources (RemoteApp, Remote Desktop, etc), you get an error.  This is because RD Web Access is simply passing the username (sans domain) to RD Gateway as if you were logging in as a local user as opposed to a domain user).  I'd be happier if it gave a "username invalid" error at the very begining!

I found this Microsoft Technet thread very helpful.  However, not being a code monkey myself, it took a lot of concentration to figure out what to really do.  I eventually asked one of our web development people to hold my hands, but it worked out in the end.

Reading through, I initially edited the login.aspx file (Lionel Chen's suggestion in the thread).  This is the login screen that shows up right after you punch the URL into Internet Explorer.  And yes, it has to be Internet Explorer because it requires Active X (why, I don't know, since it justs invokes the Remote Desktop Client via a custom RDP file).  There was a way to insert the domain into the username text box.  However, the cursor defaults to the beginning of the line so if a user starts typing their username right away (from habit), it would become "usernamedomain\" all mashed up.

That won't work.  Now what?

Well, further into the thread, Ross CP's idea was to modify the javascript to add the "domain\" before the username.  This worked, but if a seasoned user already typed in their domain, you're essentially sending "domain\domain\username" or "domain\username@domain.com".

Further down the thread, Markus E improved the code to check for any backslashes or @ symbols in the input.  If it detects any, it would skip the code that adds "domain\" to the username.
 
The Bright Side
In the end, it was a painful ordeal for a simple request: force a default domain.  Why doesn't Microsoft allow us to do this without stupid hacks?

On the bright side, I learned a little Javascript.  Also, the payoff was worth it.  The result was more elegant than training all 1000 users or messing with Microsoft's insistance on "domain\" continuity.

I hope this helps someone out there.
Article originally appeared on Rants from a tech addict. (http://www.guytechie.com/).
See website for complete article licensing information.