WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Search All Users in AD for a Property


Question:

I am trying to use Winbatch to search all users in a domain, see who has "POG_Bartow_Login.bat" in the description line (not case sensitive), and save this to a file. So far, I have only been able to dump a full list of domain members to a tab delimited text file that can be imported to excel.

Answer:

If you literally mean the description field, the following will work on a given domain. If you mean description in the more generic sense then you will have to determine which field of the user object contains the file name.
AddExtender("wwads44i.dll")

; Restrict the search to one domain.
sAdsiPath = "LDAP://shamrock/dc=jclass,dc=org"

; Look for all users with POG_Bartow_Login.bat in there description.
lPath= dsFindPath(sAdsiPath,  "(&(objectCategory=person)(objectClass=user)(description=*POG_Bartow_Login.bat*))")

Message("Users found", lPath)

Article ID:   W16809
File Created: 2007:07:03:14:26:22
Last Updated: 2007:07:03:14:26:22