Getting Access when your machine is not on the domain
It can be frustrating when you walk into a client site and not be able to work. I like my laptop. It is huge by comparison to most machines that companies supply. I have a nice 17” screen, a full size keyboard (I have big fat hands and fingers to go along with my 6’ 8” frame), and all the software installed that I could need when walking into a client. Running 4 versions of SQL (2005, 2008, 2008R2, 2012), multiple versions of Visual Studio (2008, 2010, 2012).
I am a Business Intelligence architect. That means I am going to need database access and SSAS, SQL and SSIS access. Most organizations use windows authentication to access the various SQL databases that I need access to, and when I need to access the SSAS cubes, windows authentication is my only option for access. This is where the problem lies. The client has given me a windows user account on their domain, but, when I open SSMS from my local machine (which has its own domain) to connect to either a cube or a database, I can’t enter my windows credentials into the dialog box. It defaults to my PC’s domain and login (see picture 1).
Even though I know the machine name (or IP address), when trying to connect, it will fail with a message about your computer’s login not being authenticated (picture 2).
Darn, I wanted to get some work done today. What am I going to do? The answer is your friend, “Run As”.
I create shortcuts to all the applications that I think I will need on my Desktop. All of the shortcuts use the “Run As” user and then point to the application that I am trying to open (picture 3).
Setting these up correctly will allow me to provide my domain credentials to the systems that I am trying to access, and it will be as if my machine is a part of the domain.
Open the properties of the shortcut, and you will see this (picture 4):
The syntax for the Target to open SSMS with the correct credentials is:
C:WindowsSystem32runas.exe /user:ANEXINETcexley /netonly Ssms.exe
Once you have that in place, you can launch the shortcut, and you will need to provide your credentials (picture 5).
Type your network password for this domain and hit ENTER. The normal connection dialog will appear, and it will STILL show your machine credentials, but, behind the scenes, it will use the login that you provided in the shortcut (picture 6).
Click “Connect” and you won’t get the nasty message that we saw in picture 2 (above), and you will be able to connect to the resources you need to do your job without having to make your computer join the domain (picture 7).
Remember, if you use any application what will need to access data that is contained in SQL Server or Analysis services, you must run that application with the credentials that have access.
I set up shortcuts for the following apps:
Visual Studio 2008: C:WindowsSystem32runas.exe /user:ANEXINETcexley /netonly “C:Program Files (x86)Microsoft Visual Studio 9.0Common7IDEdevenv.exe”
Visual Studio 2010: C:WindowsSystem32runas.exe /user:ANEXINETcexley /netonly “C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEdevenv.exe”
Visual Studio 2012: C:WindowsSystem32runas.exe /user:ANEXINETcexley /netonly “C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDEdevenv.exe”
SSMS: C:WindowsSystem32runas.exe /user:ANEXINETcexley /netonly Ssms.exe
Excel: C:WindowsSystem32runas.exe /user:Anexinetcexley /netonly “C:Program Files (x86)Microsoft OfficeOffice15EXCEL.EXE”
In conclusion, setting these shortcuts up when you walk in the door will help you hit the ground running (as long as you don’t have to wait 2 weeks for identity provisioning by the company you are working for). I hope this helps.