Here is a piece of my code that works perfectly
CODE
'This section adds the new user to the Department Security Group
Set objGroup = GetObject ("LDAP:// cn=Bingo,OU=NLC Departments,dc=nlc,dc=com")
Set objUser = GetObject("LDAP:// cn=John Public,OU=NLC Users,dc=nlc,dc=com")
objGroup.add(objUser.ADsPath)
Set objGroup = GetObject ("LDAP:// cn=Bingo,OU=NLC Departments,dc=nlc,dc=com")
Set objUser = GetObject("LDAP:// cn=John Public,OU=NLC Users,dc=nlc,dc=com")
objGroup.add(objUser.ADsPath)
I have two variables that are captured in my form .. strDepartment & strUser that I am having problems inserting into the above LDAP statement in the CN field. The strDepartment Variable can be chosen from a drop down list that reads from my AD. There can be 12 choices, I used CN=Bingo as a test example, any of the other 11 work as well.
When I try it like this I get object not found on server.. I have used the & symbol and Quotes “” in various spots but cannot seen to find the correct syntax. any ideas?
CODE
'This section adds the user to the Department Security Group
Set objGroup = GetObject ("LDAP:// cn=strDepartment,OU=NLC Departments,dc=nlc,dc=com")
Set objUser = GetObject("LDAP:// cn=strUser,OU=NLC Users,dc=nlc,dc=com")
objGroup.add(objUser.ADsPath)
Set objGroup = GetObject ("LDAP:// cn=strDepartment,OU=NLC Departments,dc=nlc,dc=com")
Set objUser = GetObject("LDAP:// cn=strUser,OU=NLC Users,dc=nlc,dc=com")
objGroup.add(objUser.ADsPath)
Thanks
Sam
