Geeks With Blogs

News Locations of visitors to this page
The Out Campaign: Scarlet Letter of Atheism

Disclaimer
The content of this site are my own personal opinions and do not represent my employer's/Microsoft view in anyway. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent point in time snapshot you should not consider out of date posts to reflect my current thoughts and opinions

About
Suresh Veeragoni, working as a Principal Consultant at Sogeti USA LLC (A subsidiary of Capgemini SA Group), developing SOA & BPM solutions for Businesses using Microsoft CSD products (BizTalk, WF, WCF etc)

My Company

Sogeti




QR-Code for my Blog

qrcode

Suresh Veeragoni's Blog A BizTalker's Blog

Problem:

Recently, when I was trying to run an InfoPath form (.xsn file) as different user from a client vista machine, which doesn't have the SQL server database access which the InfoPath form needs.

The problem is more specific to InfoPath (as it allows only two types of authentication to SQL Server through InfoPath (NT and SQL User).So when you design InfoPath form to use NT access which is not a SQL User, it must run InfoPath natively as the NT user who have access rights on SQL User. But if you design InfoPath form to use a SQL User account, any NT user can access the SQL Server using the InfoPath.

But this solution is generic for any file (not just .exe or xsn file).

First, here is the screenshot when you try to access without using run as but enter the required user credentials using InfoPath.

image

so, when you use the checkbox, it takes the credentials of logged user(which will be YOU), where you/customer may not have access on the database directly.

When we don't use the checkbox, it will become a SQL authentication. If the credentials you are entering is not a SQL user on the database.it won’t authenticate.

Solutions:

So, what are the alternatives?

1) Login to the machine as the same NT user who have access

2) Use “runas” feature, which is not straight forward.

Now, I will talk about the 2nd solution which I mentioned.

Download ShellRunAs exe file from sysinternals site.

here is the commandline to open the file. You give the path of client application which opens that file type (in my case I MUST mention the path of InfoPath exe. Without that it wont work. for ex: if you are opening notepad, you must mention the notepad in the command line argument)

image 

Then it will prompt you to enter credentials using which you will get NT user access to the Database.

image

so, this kind of things can be applied to any client applications, which needs actual NT authentication without switching users on your vista machine.

HTH

Technorati Tags: ,,
Posted on Friday, April 17, 2009 10:37 AM Technology | Back to top


Comments on this post: How to Run as different user for any type of file on Vista

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © microsoftian | Powered by: GeeksWithBlogs.net