Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

 

When subscribed to the list you should use your standard email client to send your posts to ActiveDir@mail.activedir.org.

List Archives

Subject: AW: [ActiveDir] Only Find and Export AD objects with valuse in specific attribute
Prev Next
You are not authorized to post a reply.

AuthorMessages
florianUser is Offline

Posts:87

02/02/2009 3:19 PM  
D'oh!



Didn't know the telephoneNumber was in the PAS - this seriously makes this
search easier.

For now I'm gonna issue a



adfind -sc pas

print its output and tape it to my wall.



Thanks for the correction, joe!



Florian



_____

Von: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] Im Auftrag von joe
Gesendet: Donnerstag, 29. Januar 2009 09:58
An: ActiveDir@mail.activedir.org
Betreff: RE: [ActiveDir] Only Find and Export AD objects with valuse in
specific attribute



The forest part won't be an issue since the telephone attribute is in the
PAS. So you can do a GC search with a null base and it would query the whole
forest regardless of your domain tree structure.



Now if this value wasn't in the PAS, this would be a little more difficult
and would normally require multiple adfind commands focused on each
individual domain (assuming multidomain forest). However, with some new
functionality I am putting into V01.40.00 (Hoping for an early Feb 09
Release... seriously) that I talk about here
(http://blog.joeware.net/2009/01/21/1593/) you could do something likeΏ]



adfind -sc domainncsl | adfind -s subtree -f
"&(objectcategory=person)(objectclass=user)(telephonenumber=*)"





As mentioned though, since this telephonenumber is in the PAS, you only need



adfind -gcb -f
"&(objectcategory=person)(objectclass=user)(telephonenumber=*)"





joe





Ώ] Note I have made a little change recently from what the blog shows in
the default scope used by AdFind when it detects multiple DNs being piped
in. Initially I left the default scope to subtree like is done in a normal
adfind query, but decided to change the default in that case to BASE and if
you want a subtree search instead, you will need to specify it. I figured
the most likely case when doing the DN piping from AdFind to AdFind would be
to want the individual BASE items queried, not subtree queries of each.





--

O'Reilly Active Directory Fourth Edition -
http://www.joeware.net/win/ad4e.htm







_____

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Florian Frommherz
Sent: Tuesday, January 27, 2009 9:11 AM
To: ActiveDir@mail.activedir.org
Subject: AW: [ActiveDir] Only Find and Export AD objects with valuse in
specific attribute

Brian,



use the * (asterisk) in LDAP queries to search for _any_ value (except
empty). I'd try the following query:



(& (objectCategory=person) (objectClass=user) (telephoneNumber=*) )



To get the list of all users with a telephone number specified (not sure if
the attribute is called telephone or telephoneNumber or something else -
you'll figure that).



The part with the forest might get a little more tricky. I doubt there is
functionality built into adfind or ldifde that follows the domain tree up to
the root, also finding domains in the forest that don't belong to your
current domain tree. I guess you'll have to fire the query for every domain
seperately.



Cheers,



Florian





_____

Von: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] Im Auftrag von Britt, Brian
Gesendet: Dienstag, 27. Januar 2009 15:01
An: ActiveDir@mail.activedir.org
Betreff: [ActiveDir] Only Find and Export AD objects with valuse in specific
attribute



Is there a way to search the entire forest for users with a value in a
specific attribute excluding all of the rest of the users who do not contain
a value in that attribute.



I would like to use ADfind or Ldifde to export that info and then import to
a test AD instance.



Specifically, I am trying to export the telephonenumber attribute for users
but I only want those who have a value not the entire forest to sort
through.



Brian Britt

Vanderbilt University

Directory Services Specialist

615-322-4676




You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > AW: [ActiveDir] Only Find and Export AD objects with valuse in specific attribute



ActiveForums 3.7
Friends

Friends

VisualClickButoton
Members

Members

MembershipMembership:
Latest New UserLatest:MrPTSai
New TodayNew Today:0
New YesterdayNew Yesterday:0
User CountOverall:5234

People OnlinePeople Online:
VisitorsVisitors:38
MembersMembers:0
TotalTotal:38

Online NowOnline Now:

Ads

Copyright 2009 ActiveDir.org
Terms Of Use