I am trying to get a list of all users of a group by first name and last name (and all subgroups if possible)
When I type in the following I get the inline error about formatting.
C:\Windows>dsquery group -name [MyGroupNameHere] | dsget group -members -expand | dsg
et user -fn -ln
dsget failed:Value for 'Target object for this command' has incorrect format.
type dsget /? for help.
C:\Windows>
I have figured out that I am getting the error because the dsget user command is seeing the nested groups and trying to treat them as users and having problems in doing so. Is there a way to filter out the groups and only look for users? The command is nearly worthless if you can only run it on groups that have no nested groups within.
Lastly I would like to be able to 'in one command' pull the first name and last name of all users in the group including any nested groups. Is this possible if I filter the groups out so I can run the command to get the first name and last name of the users listed?
You can see where below this command works on a group without nested users:
C:\Windows>dsquery group -name [MyGroupName] | dsget group -members -expand | dsge
t user -fn -ln
fn ln
Betty Xxxxxxxx
Lori Xxxxxxx
dsget succeeded
C:\Windows>
Thanks for any help.