Talk About Network

Google





Software > ADSI General > Getting "Genera...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 5288 of 5437
Post > Topic >>

Getting "General access denied error" while creating new account

by tmjnsk@[EMAIL PROTECTED] May 28, 2008 at 11:22 AM

Hi,

I have web application which creates user on the same server where
application is running.

It works on my local but when i deploy, it says general errror

System.UnauthorizedAcces***ception: General access denied error
   at System.DirectoryServices.Interop.IAds.SetInfo()
   at System.DirectoryServices.DirectoryEntry.CommitChanges()

I have given admin rights to ASP.NET user and the one who connected to
the appliction also has Admin Rights to the system.  What else i am
missing on the security level?

<identity impersonate="false" />  in my config.

Can some one help me..

Thanks in advance
Malar

Below is the code for creating an user

DirectoryEntry  objAD;
DirectoryEntry objNewUser;
DirectoryEntry objGrp;
string strConn;

//active directory connection string
strConn = "WinNT://"+ Environment.MachineName + "," + "computer";

//active directory entry point for above connection string
objAD = new DirectoryEntry(strConn);

//new user is added
objNewUser = objAD.Children.Add(sUserName, "user");
objNewUser.Invoke("SetPassword", new object[] {sPassword});
objNewUser.Invoke("Put", new object[] {"Description", sfullName});
objNewUser.CommitChanges();

//finding group
objGrp = objAD.Children.Find("Users", "group");

//adding new user to group
if (objGrp.Name != "")
{
	objGrp.Invoke("Add", new object[] {objNewUser.Path.ToString()});
}//endif
sRetVal="true";
 




 2 Posts in Topic:
Getting "General access denied error" while creating new account
tmjnsk@[EMAIL PROTECTED]   2008-05-28 11:22:00 
Re: Getting "General access denied error" while creating new acc
"Joe Kaplan" &l  2008-05-28 13:45:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Thu Jan 8 21:16:58 PST 2009.