I'm trying to add a Active Directory user account to a Active Directory group on a ASP web application.
My Partial code is:
Try
Dim newgroup As New DirectoryEntry()
Dim strGrpPath As String
strGrpPath = "LDAP://network.ncf.edu/CN=STAFF,OU=Groups,DC=network,DC=ncf,DC=edu"
newgroup.Path = strGrpPath
Dim NewGrpMbr As String = "LDAP://network.ncf.edu/CN=DAN HAYWOOD,OU=ITS,OU=New College,DC=network,DC=ncf,DC=edu"
newgroup.Invoke("Add", NewGrpMbr)
Catch ex As Exception
lblValid.Visible = "True"
lblValid.Text = (ex.Message.ToString)
Finally
newgroup.Close()
End Try
Everything works fine when I step thru the code using the debugger. However, when I run the application without using the debugger, the user is not added to the group and I do not get any errors.
I can't understand why it will not work when it's not in debug mode.....
Can anyone HELP?
My Partial code is:
Try
Dim newgroup As New DirectoryEntry()
Dim strGrpPath As String
strGrpPath = "LDAP://network.ncf.edu/CN=STAFF,OU=Groups,DC=network,DC=ncf,DC=edu"
newgroup.Path = strGrpPath
Dim NewGrpMbr As String = "LDAP://network.ncf.edu/CN=DAN HAYWOOD,OU=ITS,OU=New College,DC=network,DC=ncf,DC=edu"
newgroup.Invoke("Add", NewGrpMbr)
Catch ex As Exception
lblValid.Visible = "True"
lblValid.Text = (ex.Message.ToString)
Finally
newgroup.Close()
End Try
Everything works fine when I step thru the code using the debugger. However, when I run the application without using the debugger, the user is not added to the group and I do not get any errors.
I can't understand why it will not work when it's not in debug mode.....
Can anyone HELP?