No announcement yet.

ADFind query

  • Filter
  • Time
  • Show
Clear All
new posts

  • ADFind query

    Need help in the query.

    I use AdFind tool to run this AD query. The query pulls the email address for the userid that I query on.

    C:\AdFind>AdFind -default -f name=xx12345 proxyAddresses sIDHistory
    AdFind V01.49.00.00cpp Joe Richards ([email protected]) February 2015

    Using server: xx.yy.zzz
    Directory: Windows Server 2012
    Base DN: DC=hh,DC=mm23,DC=net

    dn:CN=xx12345,OU=jax,OU=Users,OU=pal,OU=kuppa,OU=m art,DC=xhost,DC=pc,DC=net
    >displayName: test user
    >proxyAddresses: smtp:[email protected]

    [email protected]------------
    I have a large number of users that I need to include in this query. For example, I have testuser1, testuser2, testuser3, testuser4......testuser10000.

    How do I add this filter to the below query.
    C:\AdFind>AdFind -default -f name=xx12345 proxyAddresses sIDHistory


  • #2
    Reading up on the tool (which I've never used) it looks like there isn't a way to provide a variable in the cmd line where the '-filter' switch goes, so you can't simply step thru a text file with the different names. Is your example of 'testuser10000' supposed to be the upper limit you want to get the results for, and your user base is actually bigger? Teh tool appears to grab results based on some attribute you focus on, like group membership or OU placement or something. How are your users organized, and can you simply run the query against the 'user' class to get everyone's info?
    MSCA (2003/XP), Security+, CCNA

    ** Remember: credit where credit is due, and reputation points as appropriate **


    • #3
      A powershell or batch script could loop through a text file and run the query against each user. If you're running a current OS then using Powershell will be easier than ADFind. I've been using ADFind for years on 2003 systems but since Powershell is available I've been using that as it is less arcane and a lot more flexible, IMO.

      Network Consultant/Engineer
      Baltimore - Washington area and beyond