Hello everyone,
I have a list of 167 user ID's. I need to query active directory and return a list that shows the user ID and their home directory path. For example:
jbsmith \\server1\home\jbsmith
jxjones \\server1\home\jxjones
Outputting a text file would work, but .csv or even excel would be helpful.
This is what I have so far:
On Error Resume Next
Set objUser = GetObject _
("LDAP://cn=testuser,ou=_USERS,dc=domain,dc=com")
objUser.GetInfo
strHomeDirectory = objUser.Get("homeDirectory")
strUserId = objUser.sAMAccountName
WScript.Echo "userid: " & strUserId
WScript.echo "homeDirectory: " & strHomeDirectory
How do I modify that so I can query from a txt file containing a list of user ID's? As it is now I'd have to run this 167 times. And how can I make it so that it outputs to .csv or .xls?
Thanks in advance for any advice!!
I have a list of 167 user ID's. I need to query active directory and return a list that shows the user ID and their home directory path. For example:
jbsmith \\server1\home\jbsmith
jxjones \\server1\home\jxjones
Outputting a text file would work, but .csv or even excel would be helpful.
This is what I have so far:
On Error Resume Next
Set objUser = GetObject _
("LDAP://cn=testuser,ou=_USERS,dc=domain,dc=com")
objUser.GetInfo
strHomeDirectory = objUser.Get("homeDirectory")
strUserId = objUser.sAMAccountName
WScript.Echo "userid: " & strUserId
WScript.echo "homeDirectory: " & strHomeDirectory
How do I modify that so I can query from a txt file containing a list of user ID's? As it is now I'd have to run this 167 times. And how can I make it so that it outputs to .csv or .xls?
Thanks in advance for any advice!!