Our AD is a bit of a mess and I'm trying to tidy things up a little bit. I'm trying to search AD to find anything in the 'Office' field. For example if 'Head Office' is in that box I need to find users who have this entered. See the image below.

ADUC Group

I've tried custom searches but the closest I've found is 'Office Location' which returns nothing. Google is less than helpful on this occasion.

Any tips welcomed.

link|improve this question

75% accept rate
feedback

1 Answer

up vote 2 down vote accepted

Most fields in active directory aren't really used for anything but custom-development. You can do custom-searches against Active Directory... but they're far-less than pretty. The "Office" field you're talking about is called the "physicalDeliveryOfficeName" in Microsoft's LDAP lookups... so you'd build a query like:

(&(objectCategory=person)(objectClass=user)(physicalDeliveryOfficeName=Head Office))

More information about the search syntax can be found here.

link|improve this answer
Perfect! Thanks very much. – Moif Murphy Jan 25 at 14:28
You can also find more attributes here: msdn.microsoft.com/en-us/library/windows/desktop/… – TheCompWiz Jan 25 at 14:29
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.