Create new member in SiteServer using Directory Services
- From: "Michael Foster" <MichaelFoster@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 May 2005 17:16:01 -0700
We currently have an existing asp site which integrates with SiteServer. We
are now looking at rebuilding the site in .NET, but one of our limitations is
that we must continue to use site server as our member storage facility.
We are attempting to use DirectoryServices to connect to SiteServer to
maintain our member base. I have no difficulties in retrieving existing
members, or updating existing members, but I am having difficulty in creating
a new member.
When I attempt to create a new member, it is not storing the member in
SiteServer. The code that I am using is below:
DirectoryEntry ldapConnObj = null;
DirectoryEntry ldapNewUser = null;
PropertyCollection ldapProperties = null;
string ldapConnection = "";
string userName = "testuser";
try
{
ldapConnection = "LDAP://xxx:xxx/o=xxx/ou=xxx";
ldapConnObj = new DirectoryEntry(ldapConnection);
ldapNewUser = ldapConnObj.Children.Add("cn=" + userName, "member");
ldapConnObj.CommitChanges();
}
catch (System.Exception e)
{
Console.Writeln(e.Message);
}
All of the code works fine, but when I attempt to retrieve the user, they
cannot be found in SiteServer. Also when I look at the Properties member of
the ldapNewUser object, it is empty. The schemaClassName property is set to
"member" and the schemaEntry property is set to
"LDAP://xxx:xxx/schema/member".
I am wondering if there is some properties that I need to set before I call
CommitChanges for the user to be commited to SiteServer? Is there anything
that I am doing wrong here?
.
- Prev by Date: Re: DropDownList -dissalow first item
- Next by Date: Using SetDataBinding method instead of DataSource property
- Previous by thread: DropDownList -dissalow first item
- Next by thread: Using SetDataBinding method instead of DataSource property
- Index(es):