I am trying to make LDAP queries using Visual Basic. I do not have administrator access to Active Directory, but I can view all user objects. I do not know what restrictions, if any, find me in the directory through LDAP: // requests.
In the Excel application that I create, I have a column for entering user IDs. When a user enters a user ID, I would like other columns to be automatically populated based on server side information associated with that user (e.g. email address)
Let's say c.Value is the identifier of the user that was entered into the spreadsheet:
strUser = "CN=" & c.Value & ",OU=User Accounts,OU=Area,OU=Users,OU=Accounts,DC=joe,DC=bloggs,DC=co,DC=uk/"
Set objUser = GetObject("LDAP://" & strUser)
The problem is that when OU = Area is known, the search is successful. However, I would like the request to check all OU areas for the UserID. As far as I can tell, they are not stored and are not reflected in a central place. Can wildcards be used in such a query?
Does anyone have any other ideas or suggestions for alternative ways to do this?
Thanks,
Tom
source share