jgrammer42
asked on
Can I use CSVDE to export the users in a specific group from AD?
I have a need to export the user information, from several specific Distribution Groups under Active Directory.
I know I can export this information using CSVDE at the command line. But I only know how to export the group level information, not the MEMBERS of that specific group.
For example, say we have the domain name of NETDOMAIN.com Under that domain, I have an OU called MYCOMPANY and under that a group called PAYROLL which has both AD users and Contacts users in it. I want to export the members of that group, and ONLY that group, and not the whole AD/LDAP directory information. If I use the CSVDE command parms of
csvde -d "OU=MYCOMPANY,DC=lou,DC=NE TDOMAIN,DC =com" -r objectClass=group -f companywidegroup-emails.cs v
That only gives me the group level information for the groups listed underneath MYCOMPANY, but I want to get the 'member' information of the specific group called PAYROLL.
Does anyone know the csvde command line parms to do this?
Thank you,
I know I can export this information using CSVDE at the command line. But I only know how to export the group level information, not the MEMBERS of that specific group.
For example, say we have the domain name of NETDOMAIN.com Under that domain, I have an OU called MYCOMPANY and under that a group called PAYROLL which has both AD users and Contacts users in it. I want to export the members of that group, and ONLY that group, and not the whole AD/LDAP directory information. If I use the CSVDE command parms of
csvde -d "OU=MYCOMPANY,DC=lou,DC=NE
That only gives me the group level information for the groups listed underneath MYCOMPANY, but I want to get the 'member' information of the specific group called PAYROLL.
Does anyone know the csvde command line parms to do this?
Thank you,
ASKER
That is pretty close. The only thing though is that it outputs the contents into one comma delimited field, and does not include other information that would be great to have like the email address.
Is there a way to export that data also, and split it out into separate fields so that it can easily be imported into a spreadsheet?
Thank you,
Is there a way to export that data also, and split it out into separate fields so that it can easily be imported into a spreadsheet?
Thank you,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hmmm....that returned zero entries. Is the syntax of "memberof=CN=" correct? Should there be any quotes around the CN, OU and DC entries?
Syntax is correct.
Try following statement and post results.
Try following statement and post results.
DSQuery * -Filter "(&(objectCategory=user)(memberOf=CN=PAYROLL,OU=MYCOMPANY,DC=NETDOMAIN,DC=COM))" -Attr Name mail -limit 0
ASKER
I used the command:
DSQuery * -Filter "(&(objectCategory=user)(m emberOf=CN =Payroll,O U=MYCOMPAN Y,DC=NETDO MAIN,DC=co m))" -Attr Name mail -limit 0
And no output was generated.
What should I have expected to see?
DSQuery * -Filter "(&(objectCategory=user)(m
And no output was generated.
What should I have expected to see?
Strange! Above command should show user's full name with email addresses.
Try this:
Click Start -> Run -> Cmd.exe ->
Try this:
Click Start -> Run -> Cmd.exe ->
DSGet Group "CN=PAYROLL,OU=MYCOMPANY,DC=NETDOMAIN,DC=COM" -members|DSGet user -dn -email
ASKER
Here is what I get using that command:
C:\Data\Exchange Info>DSGet Group "CN=PAYROLL,OU=MYCOMPANY,D C=NETDOMAI N,DC=
COM" -members|DSGet user -dn -email
dsget failed:Directory object not found.
type dsget /? for help.dsget failed:`Target object for this command' is missing.
type dsget /? for help.
yeah, kind of odd.....because it obviously DOES exist because the very first command you had me try did work, just did not pull all the info I wanted.
Oh well, this really is not a big deal, I was just trying to make it easier on myself, rather than having to "hand check" all of the members in the group.
C:\Data\Exchange Info>DSGet Group "CN=PAYROLL,OU=MYCOMPANY,D
COM" -members|DSGet user -dn -email
dsget failed:Directory object not found.
type dsget /? for help.dsget failed:`Target object for this command' is missing.
type dsget /? for help.
yeah, kind of odd.....because it obviously DOES exist because the very first command you had me try did work, just did not pull all the info I wanted.
Oh well, this really is not a big deal, I was just trying to make it easier on myself, rather than having to "hand check" all of the members in the group.
Distinguished Name of the group must be wrong!!!
Apply following statement to get correct group DN
Apply following statement to get correct group DN
DSQuery Group -Name PAYROLL
ASKER
You are absolutely correct....I was missing a level in between!
There was another OU level (Groups), between the OU=MYCOMPANY. I change your original CSVDE command of
CSVDE -R "(&(objectCategory=user)(m emberOf=CN =PAYROLL,O U=MYCOMPAN Y,DC=NETDO MAIN,DC=CO M))" -L mail -F companywidegroup-emails.cs v
to read
CSVDE -R "(&(objectCategory=user)(m emberOf=CN =PAYROLL,O U=GROUPS, OU=MYCOMPANY,DC=NETDOMAIN, DC=COM))" -L mail -F companywidegroup-emails.cs v
And it gave me back exactly what I was looking for.
Thanks!
There was another OU level (Groups), between the OU=MYCOMPANY. I change your original CSVDE command of
CSVDE -R "(&(objectCategory=user)(m
to read
CSVDE -R "(&(objectCategory=user)(m
And it gave me back exactly what I was looking for.
Thanks!
ASKER
Slight error in AD directory pathing on my part. Original answer was 100% correct.
I used below command to its working fine to export members of one group.
BUT MY OBJECTIVE is, I have a list of 20 SL group names, Need to verify if user is a member of any one of these group, IF yes it should list the group names,
Please help
CSVDE -R "(&(objectCategory=user)(m emberOf=CN =groupname ,OU=GROUPS ,DC=xxx,DC =XYZ,DC=NE T))" -L samaccountname -F companywidegroups.csv
BUT MY OBJECTIVE is, I have a list of 20 SL group names, Need to verify if user is a member of any one of these group, IF yes it should list the group names,
Please help
CSVDE -R "(&(objectCategory=user)(m
Open in new window