How to a run the ASP worker process under another user credential

Well i discovered this when i had to debug a service on a server on which i no permissions.Since it was a WCF call and was hosted on the IIS,i figured i needed a cheat.So this is what i did.Before i start with the details let me tell you the environments that i have been using.VS-Studio –2008 dotnet stack on Windows XP(sp3).And i was using IIS 5.1 on my machine which is an XP.So here goes.

First change the username and password in the machine.config under the processModel tag as shown below.

Code Snippet
  1. <system.web>
  2.     <processModel autoConfig="true" userName="username" password="******"/>
  3.     <httpHandlers/>

And i tried adding permission to the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files folder too.

That resulted in an error which gave an “Failed to access IIS metabase” error .So finally i figured MetaAcl tool needs to be downloaded from the following location

http://download.microsoft.com/download/5/7/3/57316f36-ded6-41f0-b694-8b0102ade818/metaacl.exe

This has a metaacl.vbs script which adds permission to the users.You need to add the file to the following folder c:\Inetpub\Adminscripts and then go this folder from the command prompt.Then run the command

c:\Inetpub\Adminscripts>cscript metaacl.vbs IIS://LOCALHOST/W3SVC
                                     mydomain\mydomainaccount RW

 

For more info go to the following KB article in MSDN.(http://support.microsoft.com/kb/326902)

Advertisements

One thought on “How to a run the ASP worker process under another user credential

  1. Woah! I’m really loving the template/theme of this blog. It’s simple, yet effective.
    A lot of times it’s very difficult to get that “perfect balance” between superb usability and visual appeal. I must say you have done a very good job with this. In addition, the blog loads very fast for me on Safari. Outstanding Blog!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s