Runtime COMException when adding directory objects
dl
Date: 06/09/05
- Next message: Dominick Baier [DevelopMentor]: "Re: Partially trusted web apps"
- Previous message: Zsolt Soczo: "Partially trusted web apps"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: Runtime COMException when adding directory objects"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: Runtime COMException when adding directory objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 9 Jun 2005 17:50:58 +0800
Hi
I have written a code-behind page with exact lines of code and it works.
string dirPath = "LDAP://ou=" + _ouName + "," + _domain;
DirectoryEntry entry = new DirectoryEntry(dirPath);
string cn = fname + " " + mi + " " + lname;
DirectoryEntry newUser = entry.Children.Add(cn, "user");
string sAMName = getsAMAcName(fname, lname, mi);
newUser.Properties["sAMAccountName"].Add(sAMName);
newUser.CommitChanges();
But when I move these lines to a class method which is then called by the
code-behind page I got errors on "CommitChanges".
Any idea, please?!
TIA
[COMException (0x80072035): The server is unwilling to process the request.]
System.DirectoryServices.Interop.IAds.SetInfo() +0
System.DirectoryServices.DirectoryEntry.CommitChanges() +37
NETDS.DirEntry.entryAdd(String fname, String lname, String mi, String
telno, Int32 flag) +307
NETDS.EntryCreate.btnEntryCreate_Click(Object sender, EventArgs e) +545
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1281
----------------------------------------------------------------------------
---- --
- Next message: Dominick Baier [DevelopMentor]: "Re: Partially trusted web apps"
- Previous message: Zsolt Soczo: "Partially trusted web apps"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: Runtime COMException when adding directory objects"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: Runtime COMException when adding directory objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]