Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



CSVD export of SMTP addresses

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 16-11-2007
randy
 
Posts: n/a
CSVD export of SMTP addresses

I am attempting to export a list of all usernames and smtp email addresses
fromt LDAP. I have the following command which works, except for the fact
that it keeps exporting the Distinguished name, even though I don't ask it to
do so. Is there a way where I can limit it to just export the two fields I
want?

csvde -r "(objectClass=user)" -d "ou=accounting,ou=domain user
accounts,dc=corp,dc=domain,dc=com" -l "cn,mail" -f c:\email.csv

Reply With Quote
  #2  
Old 16-11-2007
\RemS
 
Posts: n/a
RE: CSVD export of SMTP addresses

"randy" wrote:

> I am attempting to export a list of all usernames and smtp email addresses
> fromt LDAP. I have the following command which works, except for the fact
> that it keeps exporting the Distinguished name, even though I don't ask it to
> do so. Is there a way where I can limit it to just export the two fields I
> want?
>
> csvde -r "(objectClass=user)" -d "ou=accounting,ou=domain user
> accounts,dc=corp,dc=domain,dc=com" -l "cn,mail" -f c:\email.csv


Use DSQuery.exe instead of csvde,
http://www.petri.co.il/forums/showthread.php?t=18464&highlight='Saved%20Queries

Or use a vbscript,
http://www.petri.co.il/forums/showthread.php?t=19411

\Rems
Reply With Quote
  #3  
Old 16-11-2007
Richard Mueller [MVP]
 
Posts: n/a
Re: CSVD export of SMTP addresses


"\RemS" <RemS@discussions.microsoft.com> wrote in message
news:42C4C20C-4547-4BE1-9F93-3755237D41A8@microsoft.com...
> "randy" wrote:
>
>> I am attempting to export a list of all usernames and smtp email
>> addresses
>> fromt LDAP. I have the following command which works, except for the fact
>> that it keeps exporting the Distinguished name, even though I don't ask
>> it to
>> do so. Is there a way where I can limit it to just export the two fields
>> I
>> want?
>>
>> csvde -r "(objectClass=user)" -d "ou=accounting,ou=domain user
>> accounts,dc=corp,dc=domain,dc=com" -l "cn,mail" -f c:\email.csv

>
> Use DSQuery.exe instead of csvde,
> http://www.petri.co.il/forums/showthread.php?t=18464&highlight='Saved%20Queries
>
> Or use a vbscript,
> http://www.petri.co.il/forums/showthread.php?t=19411
>
> \Rems


Just to elaborate, the csvde command always outputs the DN, whether you ask
for it or not. The reason is that DN uniquely identifies the objects. Note
that the cn attribute does not. There could be several objects in the domain
with the same value assigned to cn, they just need to be in different OU's
or containers. Another attribute that will uniquely identify the users (in
the domain) is sAMAccountName (pre-Windows 2000 logon name). That might be a
better choice.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


Reply With Quote
  #4  
Old 16-11-2007
randy
 
Posts: n/a
RE: CSVD export of SMTP addresses

I have tried this command, however it results in returning names from all
ou's, how can I limit to specifc OU's for searching?

cmd /c dsquery.exe * -limit 0 -filter
"(&(objectCategory=person)(objectClass=user)(mail=*))" -attr name mail
>"c:\PrimaryEmailAddresses.txt"


"\RemS" wrote:

> "randy" wrote:
>
> > I am attempting to export a list of all usernames and smtp email addresses
> > fromt LDAP. I have the following command which works, except for the fact
> > that it keeps exporting the Distinguished name, even though I don't ask it to
> > do so. Is there a way where I can limit it to just export the two fields I
> > want?
> >
> > csvde -r "(objectClass=user)" -d "ou=accounting,ou=domain user
> > accounts,dc=corp,dc=domain,dc=com" -l "cn,mail" -f c:\email.csv

>
> Use DSQuery.exe instead of csvde,
> http://www.petri.co.il/forums/showthread.php?t=18464&highlight='Saved%20Queries
>
> Or use a vbscript,
> http://www.petri.co.il/forums/showthread.php?t=19411
>
> \Rems

Reply With Quote
  #5  
Old 16-11-2007
\RemS
 
Posts: n/a
RE: CSVD export of SMTP addresses

enter the DN of the ou as <startnode>.
http://www.jsifaq.com/SF/Tips/Tip.aspx?id=7330
The DN must be between quotes.
And maybe? you might also want to use the parameter: -scope onelevel

cmd /c dsquery.exe * "OU=name3,OU=name2,OU=name1,DC=domain,DC=local" -scope
onelevel -limit 0 -filter
"(&(objectCategory=person)(objectClass=user)(mail=*))" -attr name mail
>"c:\PrimaryEmailAddresses.txt"


\Rems

"randy" wrote:
> I have tried this command, however it results in returning names from all
> ou's, how can I limit to specifc OU's for searching?
>
> cmd /c dsquery.exe * -limit 0 -filter
> "(&(objectCategory=person)(objectClass=user)(mail=*))" -attr name mail
> >"c:\PrimaryEmailAddresses.txt"

>
> "\RemS" wrote:
>
> > "randy" wrote:
> >
> > > I am attempting to export a list of all usernames and smtp email addresses
> > > fromt LDAP. I have the following command which works, except for the fact
> > > that it keeps exporting the Distinguished name, even though I don't ask it to
> > > do so. Is there a way where I can limit it to just export the two fields I
> > > want?
> > >
> > > csvde -r "(objectClass=user)" -d "ou=accounting,ou=domain user
> > > accounts,dc=corp,dc=domain,dc=com" -l "cn,mail" -f c:\email.csv

> >
> > Use DSQuery.exe instead of csvde,
> > http://www.petri.co.il/forums/showthread.php?t=18464&highlight='Saved%20Queries
> >
> > Or use a vbscript,
> > http://www.petri.co.il/forums/showthread.php?t=19411
> >
> > \Rems

Reply With Quote
  #6  
Old 12-01-2009
devina
 
Posts: n/a
Re: CSVD export of SMTP addresses

I am 38 years old and have no money. ? I have so many debts. I am a disabled experienced person and I heard that I may be qualified to receive a grant to use in conjunction with my down payment or in lieu of a down payment to assist me in home ownership. Is this true I am looking for any housing grant. Is there any one who can help me? Thank you very much.
Reply With Quote
  #7  
Old 13-01-2009
Pegasus \(MVP\)
 
Posts: n/a
Re: CSVD export of SMTP addresses (Spam)

Putting out spam messages won't win you any friends.


Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "CSVD export of SMTP addresses"
Thread Thread Starter Forum Replies Last Post
Need a vbscript which can export sAMAccount names and Primary SMTP addresses freddy_devi Windows Software 1 08-06-2012 06:41 PM
Export Names and Email Addresses from Thunderbird Mustafa k Technology & Internet 5 13-01-2011 06:40 AM
Export email addresses from mail? The!Winston Technology & Internet 5 21-10-2010 09:01 AM
SMTP communication problem smtp;550 - emails bouncing back Antonio00 Small Business Server 1 03-04-2008 01:05 AM
Export Usernames and Email Addresses settler Active Directory 3 11-02-2005 02:28 AM


All times are GMT +5.5. The time now is 05:50 PM.