I'm trying to add a user to a group. This is a Novell user, but it should be similar to Active Directory. Here's the code I have, but it doesn't seem to work. It returns the user's name, but doesn't add them to the group. Any help would be appreciated!
vb Code:
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim UserAccount As New DirectoryServices.DirectoryEntry("LDAP://172.16.10.151:389/cn=" + TextBox1.Text + ",ou=teachers,o=myOrg", "cn=admin,o=myOrg", "myPassword", DirectoryServices.AuthenticationTypes.FastBind) MessageBox.Show(UserAccount.Properties("givenName").Value & " " & UserAccount.Properties("sn").Value) UserAccount.Properties("groupMembership").Add("cn=myGroup,OU=teachers,O=myOrg") End Sub End Class




Reply With Quote