Hi everyone hope you are all well.
Guys I have the following command that does what Id like but it only does it on ONE group specified, as the following shows:
dsquery group -name "AU-SG GROUPX" | dsget group -members | dsget user -samid
Output of the above command gives a list of users for the group AU-SG GROUPX, as the following shows:
samid
msimons
ajones
tsmith
What id like to do is the following:
Instead of having to input the group name after the -name switch, as follows:
dsquery group -name "AU-SG GROUPX" | dsget group -members | dsget user -samid
Id like to be able to point the -name switch to a text file of group names, then loop through each group name in a text file, and output the usernames.
eg.
dsquery group -name c:\groups.txt | dsget group -members | dsget user -samid
Any help on this greatly appreciated.
Open in new window