Add an user to a group with .NET and Site Server 3.0 
Author Message
 Add an user to a group with .NET and Site Server 3.0

I'm I the only one here who's trying to use C# and Site Server 3?? All
samples I see talk about AD or IIS, but I can't find sample for Site Server
3.0.

I can add users to the P&M LDAP server without any problem... but I can't
add an user into an existing group...

I know, by looking at old VB6 code that I must create a "memberOf" object to
put into the "member" collection of the group object... but how can I do
this with the DirectoryEntry object... I tried this sample (look below) I
found on the net, but this sample is for the Windows Active Directory and it
doesn't work for me... maybe I'm missing something?

--Begin Code Snip--

oDirEntry.Path = "LDAP://123.45.678.095:5325/o=SSQG";
DirectoryEntry oGroup = oDirEntry.Children.Find("cn=MyGroup,ou=groups");

//Exception: "The directory property cannot be found in the cache."
oGroup.Invoke("add", new object[]
{LDAP://123.45.678.095:5325/cn=myusername,ou=members,o=SSQG});

oGroup.CommitChanges();

--End Code Snip--



Mon, 28 Feb 2005 04:16:01 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Add a domain Group/User to a local computer group

2. Site Server 3.0 and DirectoryEntry problem

3. Users and Groups on Novell-Server

4. ADSI - Adding a user to a selected group

5. Temporarily add user to local admin group

6. Add Users and Groups dialog

7. Add User to Group

8. adding and removing users from groups on an NT Domain

9. Add/ Remove User to/ From Group using System.DirectoryServices ADSI interface

10. C#.NET User Group - 10 months old - Over 1000 members

11. .NET user group topics are getting BORING........

12. Bay.net user's group meeting

 

 
Powered by phpBB® Forum Software