Mmm I took what you pasted below, is that the whole query?
 
I don't think I have seen many good queries from Exchange, all of them seem inefficient or over complicated. Plus we have found that the RUS doesn't process the queries for the AL's the same way that AD does so if you set up a query for an AL and it looks ok in the preview of ESM it doesn't necessarily mean it will really work because the RUS doesn't actually send the query to AD, it processes it on its own against every object in AD that changes that it finds some other way.
 
On this query, if it is supposed to be have the homeMDB and Server Name or don't have either the query should be
 
(&
  (mailnickname=*)
  (|
    (&
      (objectCategory=person)
      (objectClass=user)
      (!
        (homeMDB=*)
      )
      (!
        (msExchHomeServerName=*)
      )
    )
    (&
      (objectCategory=person)
      (objectClass=user)
      (&
        (homeMDB=*)
        (msExchHomeServerName=*)
      )
    )
  )
)
 
or the shorter simpler form would be
 
(&
  (mailnickname=*)
  (|
    (&
      (objectCategory=person)
      (objectClass=user)
      (!
        (homeMDB=*)
      )
      (!
        (msExchHomeServerName=*)
      )
    )
    (&
      (objectCategory=person)
      (objectClass=user)
      (homeMDB=*)
      (msExchHomeServerName=*)
    )
  )
)
 
 
-------------
http://www.joeware.net   (download joeware)
 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mulnick, Al
Sent: Thursday, March 18, 2004 10:38 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] running a user query

I think you missed part of it, but it could be done better I'd guess.  Something about a best practice for efficient queries and this don't quite match :)
 
mailnickname is a requirement no matter what.  It's mailnickname is populated and then either have the homeMDB and msExchHomeServerName populated or don't have either.
 
For Mark's purposes, I'd narrow that down to say that anyone with a mailnickname that also has homeMDB and msExchHomeServerName populated could be considered one of his.  I wouldn't leave it as broad as the GAL user search criteria.  I'd also report out the server and db that the users' mail store reside in for two reasons: 1) because it's more useful for reporting and 2) because if you ever delete a user mailbox and want to reconnect that user, it's sooooooo much easier to look up where they're mailstore is rather than hunting through a ton of db's in the hopes of finding.  I've taken that to the point of exporting that data via a vb program every night that takes that into account.  Script could do same, but I find it very valuable to have the information.
 
Al 
 
 


From: joe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 8:17 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] running a user query

I am wondering if I am reading that filter incorrectly....
 
(&
  (mailnickname=*)
  (|
    (&
      (objectCategory=person)
      (objectClass=user)
      (!
        (homeMDB=*)
      )
      (!
        (msExchHomeServerName=*)
      )
    )
    (&
      (objectCategory=person)
      (objectClass=user)
      (|
        (homeMDB=*)
        (msExchHomeServerName=*)
      )
    )
  )
)
 
 
It seems to be looking for any user with the mailnickname set which is obviously easier written as (&(objectcategory=person)(objectclass=user)(mailnickname=*)).
 
 
The other parts basically say
 
User without homemdb and without ms exch server name
  OR
User with homemdb or ms exch server name
 
Which wouldn't that be ANY user? So it translates overall to any user with mailnickname.
 
Did I blow it?
 
-------------
http://www.joeware.net   (download joeware)
 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mulnick, Al
Sent: Wednesday, March 17, 2004 4:35 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] running a user query

Just having data in the mail attribute is not neccessarily an indication that they have a mailbox.  That could have been put in manually or that object could be a contact or a non-mailbox-enabled user entity etc.
 
Look for a search criteria that looks for more than one attribute such as homeMDB & mail both having an attribute and an objectcategory of person & objectClass of User.  You may want to add in there that the search criteria must also find msExchHomeServerName must have data as well.  
 
You may then want to return the users that match the criteria, the homeMDB and or the msExchHomeServerName in the report.
 
Here's the default GAL search criteria for building all users (mailbox-enabled user objects) in Exchange for reference.
 
(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))
 


From: Creamer, Mark [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 2:33 PM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] running a user query

I need to get some information on all of our users for a manager here. I have a script I can alter to get the information, but can I assume that if the user has a value in the "mail" attribute that he or she has an Exchange account? What the manager ultimately wants is a list of all users, and whether or not there is a mailbox associated with them. Thanks!

 

Mark Creamer

Systems Engineer

Cintas Corporation

Honesty and Integrity in Everything We Do

 

Reply via email to