Discussion:
Export Dist groups from AD using CSVDE???
(too old to reply)
jrm73
2006-12-20 16:09:09 UTC
Permalink
I am in the midst of a migration to Exchange 2003. We have to Exchange
environments going (5.5 and 2003) and therefore users have accounts in
both. We also have the dist. groups in both. I need to export the
dist groups from AD and am having trouble. I don;t need the members
(yet) just want a list. I've userd csvde to export a list of user
accounts from withn an OU and feel this should be any different. All
out dist groups are in a separt OU and I've used the following syntax.

csvde -f distgroups.csv -l name -d
"ou=users,ou=distgroups,dc=Mydomain,dc=org"

I opened adsiedit and fond the name to check the name of a dist group
so I could get the attribute name. The attribute was listed as "name."
I've also tried "SamAccountName" with no luck


Results are:

Connecting to "(null)"
Logging in as current user using SSPI
Exporting directory to file distgroups.csv
Searching for entries...
Writing out entries

No Entries found

Any ideas and help would be greatly appreciated.

Thanks
Richard Mueller
2006-12-20 18:02:45 UTC
Permalink
You need to use the -r switch to filter on distribution groups. The command
would be (watch line wrapping, this is one line):

csvde -f distgroups.csv -l sAMAccountName -r
"(&(objectCatgory=group)(!groupType:1.2.840.113556.1.4.803:=2147483648))"

I did not use the -d switch to specify the base of the search, so my command
returns all distribution groups in the domain. If you want to limit the
groups retrieved to those in a container or OU, use the -d switch. I also
returned the sAMAccountName instead of Name. Name returns the Relative
Distinguished Name (RDN), which is the value of the cn (Common Name)
attribute. csvde always returns the distinguishedName (DN), which includes
the RDN. The value of sAMAccountName is the NetBIOS name of the object (the
NT Name). This usually is the same as the value of cn for group objects, but
it does not have to be. To retrieve membership of the groups, add the member
attribute to the list. The DN's of all direct members will be in one field,
delimited by semicolons.

For info on this and other filters, see this link:

http://www.rlmueller.net/ADOSearchTips.htm

The filters used with ADO can also be used with csvde.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
Post by jrm73
I am in the midst of a migration to Exchange 2003. We have to Exchange
environments going (5.5 and 2003) and therefore users have accounts in
both. We also have the dist. groups in both. I need to export the
dist groups from AD and am having trouble. I don;t need the members
(yet) just want a list. I've userd csvde to export a list of user
accounts from withn an OU and feel this should be any different. All
out dist groups are in a separt OU and I've used the following syntax.
csvde -f distgroups.csv -l name -d
"ou=users,ou=distgroups,dc=Mydomain,dc=org"
I opened adsiedit and fond the name to check the name of a dist group
so I could get the attribute name. The attribute was listed as "name."
I've also tried "SamAccountName" with no luck
Connecting to "(null)"
Logging in as current user using SSPI
Exporting directory to file distgroups.csv
Searching for entries...
Writing out entries
No Entries found
Any ideas and help would be greatly appreciated.
Thanks
Loading...