Wednesday, August 8, 2012

Make Applications Work With Remote Domain Environment On Unconnected Computer

Working remotely via VPN in an environment where you are not attached to the domain is a pain if windows authentication is in use. Windows doesn't handle domain changes as gracefully as it should, especially if I was only going to be on it for a couple weeks. Fortunately, there are ways that you can remove the road blocks by creating some shortcuts and modifying the shortcuts.

Here are some examples of the shortcut targets I made: (obviously, change the domain\username to your domain credentials for the remote environment)
C:\Windows\System32\runas.exe /user:domain\username /netonly "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
C:\Windows\System32\runas.exe /user:domain\username /netonly "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
C:\Windows\System32\runas.exe /user:domain\username /netonly "%comspec% /k \"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat\" x86"
C:\Windows\System32\runas.exe /user:domain\username /netonly "C:\Program Files (x86)\Microsoft Visual SourceSafe\ssexp.exe"

In some cases you may need to run the applications as administrator. The easiest way I found to escalate privileges:
  1. Right-click on the shortcut
  2. Click Properties
  3. On the "Shortcut" tab, click "Advanced..."
  4. Check the "Run as administrator" checkbox
  5. Click OK (closes the Advanced Properties dialog)
  6. Click OK (closes the Properties dialog)
Now anytime you run that shortcut, it will run as administrator.

This method removed all of my authentication issues and I could development as usual.

No comments: