Mohsen.Sharify
Mohsen.Sharify

Reputation: 257

Using System.DirectoryServices to create account in IIS did not work

I am using System.DirectoryServices namespace to creating user accounts. when I run my webapp in asp.net and in my system, then code worked good. But when I deploy my webapp in my IIS, this failed.

I tested this way:

  1. created a console application that get arguments from commandline and create user for me. When I run console exe directly, user created, but this exe not run from my web application (of course this code work in asp.net and in my system too).

  2. enabling "World Wide Web Publishing Service" to interact with desktop.

Can someone help me?

Upvotes: 0

Views: 86

Answers (1)

Adam Zuckerman
Adam Zuckerman

Reputation: 1641

The issue is related to the user you are executing the code as. When you are running locally or using the console application, the application is using your credentials for authentication. When run under IIS, the typical user is IUser, which has fewer privileges. You may need to grant the additional privileges to the IUser user in order to create the user accounts.

Upvotes: 2

Related Questions