DESIGNUTT
asked on
using AD dsquery, I need a user list with group membership piped to a file.
I am trying to use the cmd line for dsquery | dsget. The ultimates results that will be useful to me is 1. the user 2. what groups it is a member of. I have tried:
dsquery user "ou=users,ou=SubOU,dc=doma in,dc=com" -o dn | dsget user -memberof > Z:\users.txt
*this gives me the groups, but I can't tell which user it belong to.
dsquery user "ou=users,ou=SubOU,dc=doma in,dc=com" -o dn | dsget user -display > z:\users.txt
*this one shows all the users in the OU, but no group membership!
I need something like
User1
- group1
- group2
User2
- group1
- group3
- group4
User3
- group2
- group3
- group5
etc...
If possible, I'd like to do this from the command line using dsquery and dsget.
thanks in advance.
dsquery user "ou=users,ou=SubOU,dc=doma
*this gives me the groups, but I can't tell which user it belong to.
dsquery user "ou=users,ou=SubOU,dc=doma
*this one shows all the users in the OU, but no group membership!
I need something like
User1
- group1
- group2
User2
- group1
- group3
- group4
User3
- group2
- group3
- group5
etc...
If possible, I'd like to do this from the command line using dsquery and dsget.
thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I reran this script. This is what I needed. Thanks so much!! You made my day a little easier.
ASKER