PC Review


Reply
Thread Tools Rate Thread

How to use dsget to export users/emails to text file?

 
 
john boy
Guest
Posts: n/a
 
      11th Dec 2003
hey there,

can anyone tell me the exact syntax using dsget to export
all my domain users and their emails to a text file please?

thank ya! :-)
 
Reply With Quote
 
 
 
 
Cry Shultz [MVP]
Guest
Posts: n/a
 
      11th Dec 2003

>-----Original Message-----
>hey there,
>
>can anyone tell me the exact syntax using dsget to export
>all my domain users and their emails to a text file

please?
>
>thank ya! :-)
>.

John Boy,

I know that this is not for 'dsget' but there is a utility
out there called ldifde that is native to WIN2000. To get
a list of all of your user accounts with all of their
attributes you could simply go to a DC and enter the
following:

ldifde -f ADUsers.ldf -r "(objectClass=user)"

Did you want to restrict that list to simply the user
account and the corresponding e-mail address?

HTH,

Cary
 
Reply With Quote
 
 
 
 
Matjaz Ladava [MVP]
Guest
Posts: n/a
 
      11th Dec 2003
Or to add what Cary said a csvde tool which as ldifde exports user info in
csv format which is IMHO more user friendly and you can directly view it in
excel ;-)

--
Regards

Matjaz Ladava, MCSE, MCSA, MCT, MVP
Microsoft MVP - Active Directory
(E-Mail Removed), (E-Mail Removed)
http://ladava.com

"Cry Shultz [MVP]" <(E-Mail Removed)> wrote in message
news:05ae01c3bfa2$8cc12060$(E-Mail Removed)...
>
> >-----Original Message-----
> >hey there,
> >
> >can anyone tell me the exact syntax using dsget to export
> >all my domain users and their emails to a text file

> please?
> >
> >thank ya! :-)
> >.

> John Boy,
>
> I know that this is not for 'dsget' but there is a utility
> out there called ldifde that is native to WIN2000. To get
> a list of all of your user accounts with all of their
> attributes you could simply go to a DC and enter the
> following:
>
> ldifde -f ADUsers.ldf -r "(objectClass=user)"
>
> Did you want to restrict that list to simply the user
> account and the corresponding e-mail address?
>
> HTH,
>
> Cary



 
Reply With Quote
 
Cary Shultz [A.D. MVP]
Guest
Posts: n/a
 
      11th Dec 2003
Matjaz,

You are correct. csvde is much more user-friendly than ldifde. I guess
that I learned ldifde first and have some affliction for it ;-)

I will try to be less 'biased' in the future! Thank you for catching me on
this.

Cary

"Matjaz Ladava [MVP]" <matjaz@_nospam_ladava.com> wrote in message
news:uL5%233c$(E-Mail Removed)...
> Or to add what Cary said a csvde tool which as ldifde exports user info in
> csv format which is IMHO more user friendly and you can directly view it

in
> excel ;-)
>
> --
> Regards
>
> Matjaz Ladava, MCSE, MCSA, MCT, MVP
> Microsoft MVP - Active Directory
> (E-Mail Removed), (E-Mail Removed)
> http://ladava.com
>
> "Cry Shultz [MVP]" <(E-Mail Removed)> wrote in message
> news:05ae01c3bfa2$8cc12060$(E-Mail Removed)...
> >
> > >-----Original Message-----
> > >hey there,
> > >
> > >can anyone tell me the exact syntax using dsget to export
> > >all my domain users and their emails to a text file

> > please?
> > >
> > >thank ya! :-)
> > >.

> > John Boy,
> >
> > I know that this is not for 'dsget' but there is a utility
> > out there called ldifde that is native to WIN2000. To get
> > a list of all of your user accounts with all of their
> > attributes you could simply go to a DC and enter the
> > following:
> >
> > ldifde -f ADUsers.ldf -r "(objectClass=user)"
> >
> > Did you want to restrict that list to simply the user
> > account and the corresponding e-mail address?
> >
> > HTH,
> >
> > Cary

>
>



 
Reply With Quote
 
john boy
Guest
Posts: n/a
 
      11th Dec 2003
Thanks all!

So, if I use CSVDE what is the syntax to export only
accounts and emails?

Thanks!


>-----Original Message-----
>Matjaz,
>
>You are correct. csvde is much more user-friendly than

ldifde. I guess
>that I learned ldifde first and have some affliction for

it ;-)
>
>I will try to be less 'biased' in the future! Thank you

for catching me on
>this.
>
>Cary
>
>"Matjaz Ladava [MVP]" <matjaz@_nospam_ladava.com> wrote

in message
>news:uL5%233c$(E-Mail Removed)...
>> Or to add what Cary said a csvde tool which as ldifde

exports user info in
>> csv format which is IMHO more user friendly and you can

directly view it
>in
>> excel ;-)
>>
>> --
>> Regards
>>
>> Matjaz Ladava, MCSE, MCSA, MCT, MVP
>> Microsoft MVP - Active Directory
>> (E-Mail Removed), (E-Mail Removed)
>> http://ladava.com
>>
>> "Cry Shultz [MVP]" <(E-Mail Removed)> wrote in message
>> news:05ae01c3bfa2$8cc12060$(E-Mail Removed)...
>> >
>> > >-----Original Message-----
>> > >hey there,
>> > >
>> > >can anyone tell me the exact syntax using dsget to

export
>> > >all my domain users and their emails to a text file
>> > please?
>> > >
>> > >thank ya! :-)
>> > >.
>> > John Boy,
>> >
>> > I know that this is not for 'dsget' but there is a

utility
>> > out there called ldifde that is native to WIN2000.

To get
>> > a list of all of your user accounts with all of their
>> > attributes you could simply go to a DC and enter the
>> > following:
>> >
>> > ldifde -f ADUsers.ldf -r "(objectClass=user)"
>> >
>> > Did you want to restrict that list to simply the user
>> > account and the corresponding e-mail address?
>> >
>> > HTH,
>> >
>> > Cary

>>
>>

>
>
>.
>

 
Reply With Quote
 
Matjaz Ladava [MVP]
Guest
Posts: n/a
 
      11th Dec 2003
csvde -f yourfile.csv -r "(&(objectCategory=Person)(objectClass=user))" -l
"sAMaccountname,mail"

--
Regards

Matjaz Ladava, MCSE, MCSA, MCT, MVP
Microsoft MVP - Active Directory
(E-Mail Removed), (E-Mail Removed)
http://ladava.com

"john boy" <(E-Mail Removed)> wrote in message
news:00d201c3c016$04ab3b10$(E-Mail Removed)...
> Thanks all!
>
> So, if I use CSVDE what is the syntax to export only
> accounts and emails?
>
> Thanks!
>
>
> >-----Original Message-----
> >Matjaz,
> >
> >You are correct. csvde is much more user-friendly than

> ldifde. I guess
> >that I learned ldifde first and have some affliction for

> it ;-)
> >
> >I will try to be less 'biased' in the future! Thank you

> for catching me on
> >this.
> >
> >Cary
> >
> >"Matjaz Ladava [MVP]" <matjaz@_nospam_ladava.com> wrote

> in message
> >news:uL5%233c$(E-Mail Removed)...
> >> Or to add what Cary said a csvde tool which as ldifde

> exports user info in
> >> csv format which is IMHO more user friendly and you can

> directly view it
> >in
> >> excel ;-)
> >>
> >> --
> >> Regards
> >>
> >> Matjaz Ladava, MCSE, MCSA, MCT, MVP
> >> Microsoft MVP - Active Directory
> >> (E-Mail Removed), (E-Mail Removed)
> >> http://ladava.com
> >>
> >> "Cry Shultz [MVP]" <(E-Mail Removed)> wrote in message
> >> news:05ae01c3bfa2$8cc12060$(E-Mail Removed)...
> >> >
> >> > >-----Original Message-----
> >> > >hey there,
> >> > >
> >> > >can anyone tell me the exact syntax using dsget to

> export
> >> > >all my domain users and their emails to a text file
> >> > please?
> >> > >
> >> > >thank ya! :-)
> >> > >.
> >> > John Boy,
> >> >
> >> > I know that this is not for 'dsget' but there is a

> utility
> >> > out there called ldifde that is native to WIN2000.

> To get
> >> > a list of all of your user accounts with all of their
> >> > attributes you could simply go to a DC and enter the
> >> > following:
> >> >
> >> > ldifde -f ADUsers.ldf -r "(objectClass=user)"
> >> >
> >> > Did you want to restrict that list to simply the user
> >> > account and the corresponding e-mail address?
> >> >
> >> > HTH,
> >> >
> >> > Cary
> >>
> >>

> >
> >
> >.
> >



 
Reply With Quote
 
Jason Robarts [MSFT]
Guest
Posts: n/a
 
      11th Dec 2003
I know the main question has been answered but I'll bite and talk about the
new tools. Although I like ldifde and csvde for some uses, the ds* tools
have advantages in some situations because you don't need to know as much
about LDAP and the attributes Active Directory uses to do some common tasks.

dsget will help you get the information about one object in AD. dsquery
will help you get information about multiple objects in AD.

The following is from the help of dsget:

"To find all users with names starting with "John" and display their office
numbers:

dsquery user -name John* | dsget user -office"


dsquery user domainroot -name * | dsget user -dn -samID

gave me reasonable looking results for the DN and samAccountName of the
users in my domain. I expect

dsquery user domainroot -name * | dsget user -dn -email

would give you the results you are looking for. I don't have email address
configured in my test domain to try it on. The dsquery user
domainroot -name * will output a list of DNs which dsget uses to fetch the
properties of the object will.

Even if you decide to go with csvde, I'd suggest looking at the help for
both dsquery user /? and dsget user /? to get more info about querying
users.

Jason
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"john boy" <(E-Mail Removed)> wrote in message
news:054c01c3bf89$d27fee10$(E-Mail Removed)...
> hey there,
>
> can anyone tell me the exact syntax using dsget to export
> all my domain users and their emails to a text file please?
>
> thank ya! :-)



 
Reply With Quote
 
Matjaz Ladava [MVP]
Guest
Posts: n/a
 
      11th Dec 2003
Your commands work perfectly Jason. We just don't have in our minds......
jet. :-)

--
Regards

Matjaz Ladava, MCSE, MCSA, MCT, MVP
Microsoft MVP - Active Directory
(E-Mail Removed), (E-Mail Removed)
http://ladava.com

"Jason Robarts [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know the main question has been answered but I'll bite and talk about

the
> new tools. Although I like ldifde and csvde for some uses, the ds* tools
> have advantages in some situations because you don't need to know as much
> about LDAP and the attributes Active Directory uses to do some common

tasks.
>
> dsget will help you get the information about one object in AD. dsquery
> will help you get information about multiple objects in AD.
>
> The following is from the help of dsget:
>
> "To find all users with names starting with "John" and display their

office
> numbers:
>
> dsquery user -name John* | dsget user -office"
>
>
> dsquery user domainroot -name * | dsget user -dn -samID
>
> gave me reasonable looking results for the DN and samAccountName of the
> users in my domain. I expect
>
> dsquery user domainroot -name * | dsget user -dn -email
>
> would give you the results you are looking for. I don't have email

address
> configured in my test domain to try it on. The dsquery user
> domainroot -name * will output a list of DNs which dsget uses to fetch the
> properties of the object will.
>
> Even if you decide to go with csvde, I'd suggest looking at the help for
> both dsquery user /? and dsget user /? to get more info about querying
> users.
>
> Jason
> --
> This posting is provided "AS IS" with no warranties, and confers no

rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "john boy" <(E-Mail Removed)> wrote in message
> news:054c01c3bf89$d27fee10$(E-Mail Removed)...
> > hey there,
> >
> > can anyone tell me the exact syntax using dsget to export
> > all my domain users and their emails to a text file please?
> >
> > thank ya! :-)

>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      12th Dec 2003
Thanks Matjaz!


>-----Original Message-----
>csvde -f yourfile.csv -r "(&(objectCategory=Person)

(objectClass=user))" -l
>"sAMaccountname,mail"
>
>--
>Regards
>
>Matjaz Ladava, MCSE, MCSA, MCT, MVP
>Microsoft MVP - Active Directory
>(E-Mail Removed), (E-Mail Removed)
>http://ladava.com
>
>"john boy" <(E-Mail Removed)> wrote in

message
>news:00d201c3c016$04ab3b10$(E-Mail Removed)...
>> Thanks all!
>>
>> So, if I use CSVDE what is the syntax to export only
>> accounts and emails?
>>
>> Thanks!
>>
>>
>> >-----Original Message-----
>> >Matjaz,
>> >
>> >You are correct. csvde is much more user-friendly than

>> ldifde. I guess
>> >that I learned ldifde first and have some affliction

for
>> it ;-)
>> >
>> >I will try to be less 'biased' in the future! Thank

you
>> for catching me on
>> >this.
>> >
>> >Cary
>> >
>> >"Matjaz Ladava [MVP]" <matjaz@_nospam_ladava.com> wrote

>> in message
>> >news:uL5%233c$(E-Mail Removed)...
>> >> Or to add what Cary said a csvde tool which as ldifde

>> exports user info in
>> >> csv format which is IMHO more user friendly and you

can
>> directly view it
>> >in
>> >> excel ;-)
>> >>
>> >> --
>> >> Regards
>> >>
>> >> Matjaz Ladava, MCSE, MCSA, MCT, MVP
>> >> Microsoft MVP - Active Directory
>> >> (E-Mail Removed), (E-Mail Removed)
>> >> http://ladava.com
>> >>
>> >> "Cry Shultz [MVP]" <(E-Mail Removed)> wrote in

message
>> >> news:05ae01c3bfa2$8cc12060$(E-Mail Removed)...
>> >> >
>> >> > >-----Original Message-----
>> >> > >hey there,
>> >> > >
>> >> > >can anyone tell me the exact syntax using dsget to

>> export
>> >> > >all my domain users and their emails to a text

file
>> >> > please?
>> >> > >
>> >> > >thank ya! :-)
>> >> > >.
>> >> > John Boy,
>> >> >
>> >> > I know that this is not for 'dsget' but there is a

>> utility
>> >> > out there called ldifde that is native to WIN2000.

>> To get
>> >> > a list of all of your user accounts with all of

their
>> >> > attributes you could simply go to a DC and enter

the
>> >> > following:
>> >> >
>> >> > ldifde -f ADUsers.ldf -r "(objectClass=user)"
>> >> >
>> >> > Did you want to restrict that list to simply the

user
>> >> > account and the corresponding e-mail address?
>> >> >
>> >> > HTH,
>> >> >
>> >> > Cary
>> >>
>> >>
>> >
>> >
>> >.
>> >

>
>
>.
>

 
Reply With Quote
 
New Member
Join Date: Jan 2010
Posts: 20
 
      8th Apr 2011
Hi

You can use the below command to extract domain users and their emails to a text file

dsquery user "OU=Test,DC=test,DC=com" -limit 0 | dsget user -dn -email>c:\temp\Users.txt

Some more commands

http://www.windowstricks.in/search/label/dsquery
http://www.windowstricks.in/search/label/dsget
http://www.windowstricks.in/search/label/command

cheers,
www.windowstricks.in
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: DSGET is returning "dsget failed:The server is not operational." shurley Microsoft Windows 2000 Active Directory 1 24th Jan 2006 05:56 AM
Dsget bug for more than 1,000 members ? What else can I use. Marlon Brown Microsoft Windows 2000 Active Directory 7 30th Aug 2004 10:18 PM
Re: Dsget bug for more than 1,000 members ? What else can I use. Paul Bergson Microsoft Windows 2000 Active Directory 1 27th Aug 2004 12:31 AM
dsmod/dsget universal group limitation busted Microsoft Windows 2000 Active Directory 1 4th Mar 2004 09:15 PM
dsget and dsquery =?Utf-8?B?RE1D?= Microsoft Windows 2000 Active Directory 4 18th Dec 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:39 AM.