Hi,

I am a newbie to scripting so be gentle with me ;-)

I have been asked to export a list of all users from our domain into an
excel spreadsheet. Data must include the following: Logon name, Email
Address, Telephone Number. Our users are in multiple OUs depending on their
office location so the script must search the whole domain.

Can you help? Please highlight the parts which need to be modified...

Many thanks,
Don Pedro

Re: Export list of users to excel speadsheet by rwh

rwh
Wed Aug 17 11:37:14 CDT 2005

You can do it with ldifde.exe. This will allow you to export users as
you mentioned.
An example would be:
ldifde -f user.txt -s DC1 -r "(objectclass=user)" -l
"sAMAccountName,mail,telephoneNumber"

(Note the screen is wrapping the text. Use the entire thing on 1 line.
You can write this into a batch file if you want or simply run i tfrom
the command prompt)
You must have at least account opreator privelages to run it.

You'd need to set the -s value to the name of one of your domain
controllers.
This will export the results to a text file, which you can then easily
import into excel.


Re: Export list of users to excel speadsheet by DonPedro

DonPedro
Thu Aug 18 03:35:02 CDT 2005

Thanks, I'll give that a try...

"rwh@rodharrison.com" wrote:

> You can do it with ldifde.exe. This will allow you to export users as
> you mentioned.
> An example would be:
> ldifde -f user.txt -s DC1 -r "(objectclass=user)" -l
> "sAMAccountName,mail,telephoneNumber"
>
> (Note the screen is wrapping the text. Use the entire thing on 1 line.
> You can write this into a batch file if you want or simply run i tfrom
> the command prompt)
> You must have at least account opreator privelages to run it.
>
> You'd need to set the -s value to the name of one of your domain
> controllers.
> This will export the results to a text file, which you can then easily
> import into excel.
>
>