G
Guest
I am trying to query AD for billing purposes. Basically, we bill remote locations based on the number of users.
I was trying to find an easy way to query AD to do this.
I want a list that displays a list of users in one column and the respective office location in a column right next to it.
I am able to run: dsquery user "ou=Users,dc=abc,dc=com" -limit 300 -o rdn > users.txt ...this creates a file with the list of users.
I am able to run: dsquery user -name * | dsget user -office ....this creates a listing of the office locations for all users (but doesnt list the usernames beside the office locations).
If you put both of these files together, the list of users will correctly match up with appropriate office locations.
I need to write a query statement to query for both and list both side by side in 2 columns. Is this possible? How?
I was trying to find an easy way to query AD to do this.
I want a list that displays a list of users in one column and the respective office location in a column right next to it.
I am able to run: dsquery user "ou=Users,dc=abc,dc=com" -limit 300 -o rdn > users.txt ...this creates a file with the list of users.
I am able to run: dsquery user -name * | dsget user -office ....this creates a listing of the office locations for all users (but doesnt list the usernames beside the office locations).
If you put both of these files together, the list of users will correctly match up with appropriate office locations.
I need to write a query statement to query for both and list both side by side in 2 columns. Is this possible? How?