Export these data from ADS

bsharath
bsharath used Ask the Experts™
on
Hi,

I want a way to export the description,User full name,NT login,Email address of all users  to a file.

REgards
Sharath
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Toni UranjekConsultant/Trainer

Commented:
Hi!

Full name is not an AD property, can you be more specific? Do you have Exchange Server in your organization?

Toni

Author

Commented:
Yes i have a exchange server...
Toni UranjekConsultant/Trainer

Commented:
Download adfind tool from: http://www.joeware.net/freetools/tools/adfind/index.htm

Syntax would be something like: "adfind -b dc=xyz,dc=com -f "objectcategory=user" description,displayname,samid,mailnickname"

Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Author

Commented:
I used this command
C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "objectcategory=user"
description,displayname,samid,mailnickname > c:\desc.txt

AdFind V01.36.00cpp Joe Richards (joe@joeware.net) February 2007

I got this.

dn:CN=Sharath Reddy,OU=Named Accounts,OU=User Accounts,OU=IND,OU=Countries,DC=Development,DC=Group,DC=co,DC=uk
Toni UranjekConsultant/Trainer

Commented:
Try this:

adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=person)(samaccountname=*)"
description cn samaccountname mailnickname -nodn -nolabel -csv > c:\desc.txt

Author

Commented:
I get this


C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname mailnickname -nodn -nolabel
-csv > c:\desc.txt
ldap_get_next_page_s: [in-ads-srv02.Development.Group.co.uk] Error 0x57 (87
) - Filter Error
Toni UranjekConsultant/Trainer

Commented:
I have tested it in environment without Echange so lose Exchange attribute:

adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn -nolabel
-csv > c:\desc.txt

Any difference?

Author

Commented:
I get this.


C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn -nolabel-csv > c:\desc
.txt

AdFind V01.36.00cpp Joe Richards (joe@joeware.net) February 2007

ERROR: Bad Command Line Arg(s)
ERROR:  nolabel-csv

Author

Commented:
Any help....
Toni UranjekConsultant/Trainer

Commented:
Typo, one space is missing:

adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn -nolabel -csv

Author

Commented:
Still get this.


C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn -nolabel -csv
"cn","samaccountname"
ldap_get_next_page_s: [in-ads-srv02.Development.Group.co.uk] Error 0x57 (87
) - Filter Error
Toni UranjekConsultant/Trainer

Commented:
There are spaces between these switches "-nodn -nolabel -csv", your error is genereted, beacuse you are missing space here: "-nolabel -csv"

adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn -nolabel
-csv > c:\desc.txt

Author

Commented:
I get this

C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname-nodn-nolabel-csv

AdFind V01.36.00cpp Joe Richards (joe@joeware.net) February 2007

Using server: in-ads-srv02.Development.Group.co.uk:389
Directory: Windows Server 2003

ldap_get_next_page_s: [in-ads-srv02.Development.Group.co.uk] Error 0x57 (87
) - Filter Error


0 Objects returned

C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname-nodn -nolabel-csv

AdFind V01.36.00cpp Joe Richards (joe@joeware.net) February 2007

ERROR: Bad Command Line Arg(s)
ERROR:  nolabel-csv


Type AdFind /help or AdFind /? for usage assistance.


C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn-nolabel-csv

AdFind V01.36.00cpp Joe Richards (joe@joeware.net) February 2007

ERROR: Bad Command Line Arg(s)
ERROR:  nodn-nolabel-csv


Type AdFind /help or AdFind /? for usage assistance.


C:\>adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=pers
on)(samaccountname=*)"description cn samaccountname -nodn -nolabel -csv
cn,"samaccountname"
ldap_get_next_page_s: [in-ads-srv02.Development.Group.co.uk] Error 0x57 (87
) - Filter Error

Author

Commented:
I have tryed with and without spaces....
Toni UranjekConsultant/Trainer

Commented:
Hi!

I have uploaded txt file which has command that's working to: https://filedb.experts-exchange.com/incoming/ee-stuff/3704-adfind.txt

HTH

Toni

Author

Commented:
Thanks get it now.

"1878","Rajesh Rayen","RajeshR","and","and"
"1879","Sharath Reddy","SharathR","and","and"

But no emailid?

Regards
Sharath
Consultant/Trainer
Commented:
There are two AD properties related to email address: mail and mailnickname. Mail is the entry on user's General tab, mailnickname is property related to Exchange's alias for mailbox. Modify the script you've downloaded to include these properties:

adfind -b dc=development,dc=group,dc=co,dc=uk -f "&(objectcategory=person)(samaccountname=*)" description cn samaccountname mail -nodn -nolabel -csv


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial