Yes, BUT – that makes the filter/query non-portable. ☺

I just copy-n-pasted the query out of a PowerShell window I already had open.

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Brian Desmond [mailto:br...@briandesmond.com]
Sent: Monday, January 09, 2012 4:44 PM
To: NT System Admin Issues
Subject: RE: Adfind & Active Email CSV Dump.

You can do it a bit easier with the –bit switch:

Adfind –csv –nodn –b “dc=domain,dc=org” –f 
“(&(objectCategory=person)(mail=*)(!userAccountControl:AND:=2))” –bit name mail 
displayName


Thanks,
Brian Desmond
br...@briandesmond.com<mailto:br...@briandesmond.com>

w – 312.625.1438 | c   – 312.731.3132

From: Michael B. Smith 
[mailto:mich...@smithcons.com]<mailto:[mailto:mich...@smithcons.com]>
Sent: Monday, January 09, 2012 1:53 PM
To: NT System Admin Issues
Subject: RE: Adfind & Active Email CSV Dump.

Adfind –csv –nodn –b “dc=domain,dc=org” –f 
“(&(objectCategory=person)(mail=*)(!userAccountControl:1.2.840.113556.1.4.803:=2))”
 name mail displayName
You won’t be able to copy-n-paste that, but if you type it in, it gives you 
what you want.

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Harry Singh [mailto:hbo...@gmail.com]<mailto:[mailto:hbo...@gmail.com]>
Sent: Monday, January 09, 2012 1:44 PM
To: NT System Admin Issues
Subject: Adfind & Active Email CSV Dump.

All --

I could use a hand with generating the output  i need using adfind. I'm trying 
to dump all active e-mail addresses excluding those belonging to Disabled Users 
to a csv file for HR. I'm using the following syntax.

C:\Tools\AdFind>adfind -csv -nodn -b "dc=domain,dc=org" -f "(&(objectCategory=
person)(objectClass=user))" name mail displayName > mailusersjan62012.csv

I suppose i could remove the -nodn and do find/replace within excel, but am 
curious if there was a way to exclude disabled users. I do keep all my disabled 
users in a single OU, so i'm assuming there could be a filter switch i could 
use but am unfamiliar with that syntax as well.

Also, the above dumps name, mail and displayname, but is there to way to only 
output if the the mail field is not null ? Since my objective is to get all 
email addresses, I don't want those users who don't have anything populated in 
the mail field to appear. Again, if i have to manipulate excel, that could work 
but it would sweet if i could accomplish everything with one command.

Regards,

Harry.




~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to listmana...@lyris.sunbeltsoftware.com
with the body: unsubscribe ntsysadmin

Reply via email to