I have a list of usernames in a spreadsheet and I would like to simply check whether or not the username exists within a VBA script in Excel. In this case the username is what we use to login to our Company's computers. In this case a letter followed by 6 numbers.

I started the following sub (just trying to get one to work before I code the looping) along with the function I'm trying to use, but have trouble knowing what to pass for the objUser. The code description said to use "objUser.Get(“distinguishedName”)" but I don't know what to do with that. For the objRootOU I pass the result of GetObject("LDAP://rootDSE") based on some internet searching of similar scripts.

Thanks for any help anyone can provide

Please Login or Register  to view this content.