Hi I need to update a SQL table which contains user codes. I need to put a '1' it the user is found in Active Directory and a '0' if not. I have this code and it works for a few but after about 10, I receive this "[Microsoft][ODBC SQL Server Driver]Timeout expired" error code. This is my main loop :
I'm using a DSN less connection to my database.
Can someone help me please!
Thanks.
Code:
objDomain.Filter = Array("User")
For Each objUser In objDomain
set objUserInfo = GetObject("LDAP://"&objUser.Name &",DC=RSSBC,DC=COM")
wscript.Echo objUserInfo.sAMAccountName
strSQL = "UPDATE E_ActiveDirectory SET ad=1 WHERE Fiche=" &objUserInfo.sAMAccountName & ";"
Set objRS = objConn.Execute(strSQL)
set objRS = Nothing
Next
I'm using a DSN less connection to my database.
Can someone help me please!
Thanks.