We needed to query AD from Exchange 2003. We know that this version is not fully "queriable" by powershell.
I'd to understand how to retrieve some important information. We had for example an archiving system that use the group membership to "understand" if your mailbox is "storable" or not.
I took the opportunity also to grab other useful info .....let's see
Why don't use AD query tool ?
So let's do some queries to understand the structure.
1. Find active users with mailbox
(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)) (& (mailnickname=*) (& (homeMDB=*)(msExchHomeServerName=*)))
2. Find active users part of a specific group (in our case the group that determine mailbox archiving)
(&(objectCategory=person))(&(
objectCategory=person)(! userAccountControl:1.2.840. 113556.1.4.803:=2))(!( objectClass=group))(&( memberOf=CN=archiving system,OU=archiving,DC=mydomain,DC=local))
I'd to understand how to retrieve some important information. We had for example an archiving system that use the group membership to "understand" if your mailbox is "storable" or not.
I took the opportunity also to grab other useful info .....let's see
Why don't use AD query tool ?
So let's do some queries to understand the structure.
1. Find active users with mailbox
(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)) (& (mailnickname=*) (& (homeMDB=*)(msExchHomeServerName=*)))
2. Find active users part of a specific group (in our case the group that determine mailbox archiving)
(&(objectCategory=person))(&(
3. Find active users NOT MEMBERS of specific group :
(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)) (& (mailnickname=*) (& (homeMDB=*)(msExchHomeServerName=*)))(!(memberOf=CN=archiving system,OU=archiving,DC=mydomain,DC=local))
4. Find users that have OMA enabled :
(&(objectCategory=person)(
objectClass=user)(! userAccountControl:1.2.840. 113556.1.4.803:=2)) (& (mailnickname=*) (& (homeMDB=*)( msExchHomeServerName=*)))(&(! msExchOmaAdminWirelessEnable= 7))
5. Find users that have OMA enabled and created after a specific date :
(objectCategory=person)((
objectClass=User))(! userAccountControl:1.2.840. 113556.1.4.803:=2)( whenCreated>=20130701000000. 0Z)(&(! msExchOmaAdminWirelessEnable= 7))
No complications, no tricks, only the essential.
Hope this helps.
See you soon.
Hope this helps.
See you soon.
No comments:
Post a Comment