THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Davide Mauri

A place for my thoughts and experiences on SQL Server, Business Intelligence and .NET

Running and application with a domain user even if you’re not in a domain.

I just discovered yesterday the possibility to run an application under the credential of a domain user, even if you’re not in a domain. This is a very useful feature for me: being a consultant I work with a lot of different customers, each one with its own domain, and each one (of course) with a different user account for myself.

I cannot join all their domains so I have to work outside the domain, or I have to create a Virtual Machine with all the tools I need and then join their domain. This, unfortunately, means a lot of installation and maintenance work.

But what I discovered yesterday simply changed my life Smile: to execute an application using a domain user, even if you’re not I a domain, all you have to do is to use the /netonly option of the runas command!

To launch Excel, for example:

runas /netonly /user:THEDOMAIN\theuser "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"

And that’s it! Now you can browse the cubes on SSAS (for example) using the software on your machine. Cool!

Published Thursday, August 18, 2011 11:45 AM by Davide Mauri
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

GS said:

The only problem with that approach that it can not be used for automation etc since you can not specify password in this statement and hence can not be part of batch file or anything similar in nature.

August 20, 2011 11:50 PM
 

JH said:

If you use Start/Run with:

C:\WINDOWS\system32\rundll32.exe keymgr.dll, KRShowKeyMgr

(changing C:\Windows as needed) you can store a user name with domain and password for a specific computer/server. When you connect to that computer windows will then use these credentials in preference to the credentials you have used to log in to the computer you are on. Beware this does save them so make sure your own computer is secure - but this does allow the automation GS desires

August 22, 2011 4:39 AM
 

Tony said:

A colleage of mine Rob pointed this out. I can't believe this really useful capability has been there and I didn't come across it. Thank you very much for this. This will really make a difference to me - for running my desktop tools within the context of another domain.

Tony S.

August 22, 2011 4:55 AM
 

Davide Mauri said:

JH: Cool! I'll try it ASAP! Thanks for sharing!

August 22, 2011 5:01 AM
 

Davide Mauri said:

Tony: You're welcome! :)

August 22, 2011 8:13 AM
 

JH said:

BTW - seeing as this is a SQL blog you might want to know my tip allows you to access SQL servers using normal SQL "Windows authorization" connections across to other domains too

August 22, 2011 1:04 PM
 

Mike B said:

Yes. I was very overjoyed when I found this trick.

August 25, 2011 12:52 AM

Leave a Comment

(required) 
(required) 
Submit

About Davide Mauri

Davide Mauri - MCP, MCAD, MCDBA, MCT, MVP on SQL Server - has worked with SQL Server since version 6.5, and his interests cover the whole platform, from the Relational Engine to Analysis Services, from architecture definition to performance tuning. He also has a strong knowledge of XML, .NET and the Object Oriented Design principles, which allows him to have the correct vision and experience to handle development of complex business intelligence solutions. Having worked as a Microsoft Certified Teacher for many years, Davide is able to pass all his knowledge to his co-workers, allowing his team to deliver high-quality solutions. He currently works as a Mentor for SolidQ and can be found speaking in many Italian and internationals events.

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement