Last post Aug 31, 2008 03:20 AM by whisky
Aug 30, 2008 03:45 PM|whisky|LINK
I have a few user groups in AD under a specific OU. I don't want to have to change the connectionstring everytime someone adds a new user group.
I tried the following but I get an error:
Conversion from type '_ComObject' to type 'String' is not valid
Can someone please help?
Aug 31, 2008 03:01 AM|ssg31415926|LINK
Aug 31, 2008 03:20 AM|whisky|LINK
Line 18 raises the error. The code that I have isn't something that I developed but an external organisation.
I approached the people who wrote the code (I have access to most of the code) and this is what they say
" For each CN that is added a new LDAP connectionstring must be added. This is not a feature or a setting that can be enhanced on KB. These are the changes to be done with Active Directory. This should be an option enabled or enhanced by Microsoft
so that you wouldn't need to add the user groups in the LDAP every time a new group is created. "
This doesn't seem right as if the client has about 50 user groups then we will need to add 50 new LDAP connections?
if clng(ADSIRealTimeUpdate) = 1 then
adsiObj = New kbADSI.user
adsiObj.Username = ADSIusername
adsiObj.Password = ADSIpassword
adsiObj.ClientID = session("clientID")
adsiObj.minUserStatus = 1
adsiObj.ServerBinding = serverBinding
adsiObj.dsnKB = ecrmKB
adsiObj.dsnUser = ecrmUser
arrConnStr = Split(ADSIconnstr, "||")
i = 0
For Each tmpConnStr In arrConnStr
adsiObj.LDAPstr = tmpConnStr
if i = 0 then
adsiObj.ImportIUserList(true) 'clear user access
adsiObj.ImportIUserList(false) 'do not clear user access
i = i + 1