|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CSVD export of SMTP addressesI 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 "randy" wrote: Use DSQuery.exe instead of csvde,
http://www.petri.co.il/forums/showthread.php?t=18464&highlight='Saved%20Queries> 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 Or use a vbscript, http://www.petri.co.il/forums/showthread.php?t=19411 \Rems
Show quote
Hide quote
"\RemS" <R***@discussions.microsoft.com> wrote in message Just to elaborate, the csvde command always outputs the DN, whether you ask 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 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. 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 Show quoteHide quote >"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 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" \RemsShow quoteHide quote "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 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.
--
devina
------------------------------------------------------------------------
devina's Profile: http://forums.techarena.in/members/devina.htm
View this thread: http://forums.techarena.in/server-scripting/853322.htmhttp://forums.techarena.in
WSUS Aproved Updates - [WP]
HP2600N Nightmare on Win2k3 server Finding files older than 2 weeks old Reading from file - batch List users that last logon was 180 days ago Creating local profiles for all AD users List all users from a different domain CTP: Error using Get-Help Script to enable user access from Dial in tab in ADUC Alerts for Performance Counters |
|||||||||||||||||||||||