Tuesday, November 3, 2009

OpenDSObject in Windows 7 "a local error has occurred"

Someone pinged me with a bug in a script on Windows 7 with a permissioned bind to AD over LDAP using the DN of a user. They received the error message: 0x8007203B error ("a local error has occurred").

From this:
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_USE_ENCRYPTION = 2
strPath = ldap://cn=machine,ou=Finance,dc=fabrikam,dc=com/
strUser = "cn=user,dc=fabrikam,dc=com"
strPassword = "4rTGh2#1"
Set objDSO = GetObject("LDAP:")
Set objThing = objDSO.OpenDSObject (strPath, strUser, strPassword, ADS_SECURE_AUTHENTICATION)

Apparently it worked under Windows XP...

The solution ... change strUser = "cn=user,dc=fabrikam,dc=com" to strUser = "fabrikam\user" or user@fabrikam.com Windows 7 does not like the user DN...

4 comments:

  1. Rosetta Stone Spanish Spain
    Great precise info, I've been searching on this topic for a while. Bookmarked and recommended!

    ReplyDelete
  2. office product key
    Aw, this was a really quality post. In theory I'd like to write like this too – taking time and real effort to make a good article… but what can I say… I procrastinate alot and never seem to get something done.

    ReplyDelete
  3. A big thank you! You saved me a lot of effort trying to figure out this error.

    ReplyDelete
  4. I was using strUser = "domain\user" and switched to strUser="user" and it worked.

    ReplyDelete

Search Brian Hehir's sites

Loading