Question : ldap query to creat a collection of all users on a certain homeserver

can anyone amend the following line of vbs to fill a collection with only people whos account lives on a certain server?

the server name is kgxfp2

im guessing its going to involve the word like and "kgxfp2" but i dont have a clue about ldap queries and i can't find anything on the web that shows me all the options available when writing one.
Code Snippet:
1:
Set colItems = objWMIService.ExecQuery("Select ds_sAMAccountName, ds_homeDirectory From ds_user WHERE ds_homeDirectory IS NOT NULL")

Answer : ldap query to creat a collection of all users on a certain homeserver

ADO can return any attribute you want to, but as you're already using the above WMI method, then the WQL to return users with a particular home directory would be as below.

% is the wildcard character in WQL.

Tony

1:
Set colItems = objWMIService.ExecQuery("Select ds_sAMAccountName, ds_homeDirectory From ds_user WHERE ds_homeDirectory LIKE '%server%'")
Random Solutions  
 
programming4us programming4us