.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Running an AppDomain using specific User identiry

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :WCF

i am writing a windows service in C# where I have to load 3rd party as well as in house DLLs in separate App Domains -- so basically its kind of a plug in architecture, where each assembly is going to run in its own app domain to main code isolation
i want to run these app domains using separate user identities based on the functionalities of the dll. Is there a way to achieve this. can somone share a code example.

I've looked into impersonation, but it seems like with impersonation, I have to impersonate every thread that I create in the app domain.

how does IIS do it when executing an ASP .net application where a specific user identity is provided in web.config. Does IIS impersonate every incoming http reauest coming for this web app or is there one uber way to assign identity to the web app so that all its requests will be running under this new identity and we don't have to impersonate every thread.

Thank You,

View Complete Post

More Related Resource Links

Hide data for specific column from a user

Greetings, I have a problem. I would like to restrict showing specific users (or roles or schemas) data in a column. First I thought DENY option will do it but figured out that it won't. DENY denies the column being in the SELECT query. I would still like to call the column but if access to the data in that column is restricted it would show only null values and not the real ones. So... I would like call the next query from user TestUser: SELECT ID,Name,Address FROM Employee But if access to Address is restricted for TestUser I would get results like: ID Name Address 1 John Smith NULL 2 Rick Ross NULL ... Is it possible to do something like that in SQL Server 2005/2008? I was thinking of storing that kind of information in a table (for which tables, which columns for which users access is restricted) and then manipulate it on the application site but my programmers tell me that they use components which always call the full table (like SELECT *).  Thank you for your answer.

new Item form assigned to a specific user

hi, i want to create an absence request form with the new item form. and when the user fill in the form he can't choose for whom he will send it for approval the form is automatically set to be send to a specific approver.   thnx

User Alert Management for a specific list versus entire SharePoint site?

It seems that to be able to manage User Alerts, one must have Full Access to the entire SharePoint site - and then use => Site Settings > User Alerts. Ideally, I would like to be able to grant access to users to only be able to manage alerts for a specific list. Is this possible (without having to do any programming) and, if so, how? If such access is only available at the site level, I will simply create a Permission Level that allows one to only "Manage Alerts" Thanks in advance for any assistance. Dave

How can I get a user list based on a specific profile property.

Hi,I am trying to query a DB and get a list of users based on a specific boolean property stored in the aspnet_profile for that user.I am aware that it wasn't possible a few years ago (http://forums.asp.net/p/988051/1277359.aspx), but was wondering whether that had changed in recent releases, or it was still not possible without trawling through the entire list of users and testing them one by one.  (My DB may become way to big for that.)Thanks in advance for any help.Regards,Ben

User Specific Values for a Drop Down "Choice" Field

I would like to create a drop down field which has some fields disabled or not visible based on the user logged in.  Is this possible?

Redirect to specific page based on user Roles

I am using Formsauthentication. My situation is as per below:the login form has codebehind :==============================protected void LoginButton_Click(object sender, EventArgs e)        {            TextBox uname = Login1.FindControl("UserName") as TextBox;            TextBox pass = Login1.FindControl("Password") as TextBox;            CheckBox rm = Login1.FindControl("RememberMe") as CheckBox;            Literal fail = Login1.FindControl("Literal1") as Literal;            if (Membership.ValidateUser(uname.Text, pass.Text))            {                /                FormsAuthentication.SetAuthCookie(uname.Text, rm.Checked);                            }        &

What is the best way to store user specific information


Hello All,

What is the best way to keep track of user specific information?

I want to show information in querys etc based upon specific properties, for instance a users belongs to a dealer, and that dealer has an ID.

So is it a good way to store that dealer ID in a session variable or should I consider a other option to use this on multiple pages.


Does anyone have good thoughts about this?





Determining the user running a cmd shell started from a web service


So I've got an application which must be accessed via only a single user via command line for licensing reasons. My solution was to make a web service running under that valid user which is called from my other applications which need to use this remote application. Seems simple and straightforward.


The interfacing method between client and server in this web service sends only two parameters, the path to the source file for the remote application to use and the destination to place the result after it is completed and returns a string as a result. The web service creates a new CMD process using ProcessStartInfo generated from the values of the parameters. I'm redirecting the input and output streams of this process so I can get the resulting output from the call to the application to determine success/failure back on the client side, so I have UseShellExecute set to false.


So remember, this web service is running under the account that has license permissions to this application. I confirmed this by adding Environment.UserName to the return string in the method which starts the process executing the command line.


However, when I test this it is acting like this isn't the proper user. I've quintuple checked that I am using the proper user and that the application behaves properly when I make the command li

how to add configured credentials user to a specific group


hello guys 

i'm wondering is there a way that i can add my configuration User to a specific role ? 

so i have this in my web.config file 

<forms loginUrl="/Account/Login.aspx">
        <credentials passwordFormat="Clear">
          <user name="Admin@Egycation.com" password="password"/>

<forms loginUrl="/Account/Login.aspx">
        <credentials passwordFormat="Clear">
          <user name="Admin@admin.com&qu

User-specific application settings vs Isolated Storage


I was wondering what's the difference between these two ways to store user-specific settings.

In isolated storage you're supposed to have the security that the path to the files is unknown. But MSDN still recommends not to store sensitive information. On the other hand, user-specific settings, maybe with default values in the app.config file, are also stored in a randomly generated folder. In this case I imagine that you can encrypt the user settings the same way you do with the app.config file.

My question is, what are the advantages of using one method over the other to store user-specific settings?

user specific routing in mvc


 I wanted to allow users to choose the "xxx" in my site  www.mydomain.com/xxx

If that "xxx" is not already used then I can give them that particular name.

Now using mvc, how can I model that routing mechanism.

Find all stored procedures/functions granted to a specific user


SQL 2005.

How can I find all routines (sp, fn) exec granted to a specific user in a given database ?

Thanks !!

Trying to create a Computer Account for a specific user?



We are coding an intranet site using .net DirectoryServices and AccountManagement to create a computer account in Active Directory with access rules allowing a specific user to add the computer to the domain. Has anyone had any success using the AccessRuleFactory method to set access rules? I'm stumped with a few aspects. So far, this is what we have...

Using AccountManagement, we can easily add the computer:

                Dim dsamComputer As New ComputerPrincipal(dsamDomainContext)
                dsamComputer.Name = UCase(txtComputerName.Text)
                dsamComputer.SamAccountName = UCase(txtComputerName.Text) + "$"
                txtDesc.Text = Trim(txtDesc.Text)
                If txtDesc.Text.Length > 0 Then dsamComputer.Description = txtDesc.Text
                dsamComputer.Enabled = True

Next we get the DirectoryEntry and ObjectSecurity for the computer. Also dim the ACE object:

                Dim deComputerDirectoryEntry As DirectoryEntry = dsamComputer.GetUnderlyingObject
                Dim adsComputerObjectSecurity As ActiveDirectorySecurity = deComputerDirectoryEntry.ObjectSecurity
                Dim adarAccessControlEntry As ActiveDirectoryAccessRule

Custom Messages and stylesheets in SSRS for a specific user


Hi All,

   I have a question regarding the custom messages, custom colors on headers and footers of the SSRS reports to be changed as the user specifies changes accordingly on the reports and prints. Is this possible in SSRS. Please advice.

How to create a workflow that submit an infopath form to a library of a specific user



can someone help me with this?

i'm using wss 3.0 and infopath 2007.

i have a form that need to be approved by a specific approver.

first when the user submit the form it send an email to the specific approver and the form is also submitted to a library.

so the approver gets an email and the approver need to get the form submitted to his library.

the email part is working fine. now i miss the library part.

i think i need to use a workflow. but how can i create a workflow that assinged a to-do item to a specific approver instead of a group.

in my library i have the following fields:

form name, created by and aprrover's name.

now i need the workflow to look up for the name of the approver and send an "assigned a to-do item" to the specific approver of the form

can someone help me with this?

Active Directory - List group managed by a specific user


Hello every body,

I need to know how I can find which groups of an active directory are managed by a specific user. The idea is to create a WinForm appication where the user enter a name and then, the code chek whicjh group of the AD is managed by the name entered.

Has someone any idea? I jusrt need specification about the Active Directory classes and methods...

Thanks ;-)

CAML query to check if user is member of a specific group


I've got a nested query caml which basically should check 3 things:

  1. Check if a task has been assigned directly to the ucrrent user
  2. Check if a task has been assigned to a group the user is in
  3. Check if the user is member of a specific

The first to bullet points work like a charm, but I can't figure out how to get the last one to work. Here is what I thought should work:

query += "<Where>";
query += "<Eq><Membership Type=\"CurrentUserGroups\">";
query += "<Value Type=\"String\">Name of my specific group</Value>";
query += "</Membership></Eq>";
query += "</Where>";

Somehow it doesn't seem to be the correct approach, is there somebody who can help me out on this? Thanks

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend