Solved

Problem with Active Directory queries

Posted on 2009-06-28
7
599 Views
Last Modified: 2012-05-07
Hi,
I have been struggling with queries in AD users & computers. I have found an easy way to list every user that have OMA enabled (outlook mobile access). But I have disovered that this list is not complete. The string im using is "(objectCategory=user)(msExchOmaAdminWirelessEnable=0)".
msExchOmaAdminWirelessEnable: 0 (is for Wireless enabled users; all the 3 features in the Exchange-Features tab).
I have found a couple of users that have all 3 features in the tab but they still dont appear in the search list. Is there anything wrong with my search string? Please help me out, this is frustrating. Btw, this is an 2003 environment.

Best regards, Alice
0
Comment
Question by:AliceGoodspeed
  • 3
  • 3
7 Comments
 
LVL 5

Expert Comment

by:karstieman
ID: 24734279
The (msExchOmaAdminWirelessEnable=0) part is correct.

Try searching more specific by replacing (objectCategory=user) with (objectCategory=person)(objectClass=user)
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 24734475

Your search doesn't account for the default value, all three enabled. If no one has changed that msExchOmaAdminWirelessEnable will not be set.

This is a full set of filters which can be used with that attribute.

All Enabled

(&(objectClass=user)(objectCategory=person)(|(!msExchOmaAdminWirelessEnable=*)(msExchOmaAdminWirelessEnable=0)))

!msExchAdminWirelessEnable captures those where the value is not set. It should return the users you're missing now.

And just in case, these are the rest of the possible filters.

Outlook Mobile Access Only:

(&(objectClass=user)(objectCategory=person)(msExchOmaAdminWirelessEnable=5))

User Initiated Synchronisation Only:

(&(objectClass=user)(objectCategory=person)(msExchOmaAdminWirelessEnable=3))

User Initiated and Up-To-Date Notifications Only:

(&(objectClass=user)(objectCategory=person)(msExchOmaAdminWirelessEnable=2))

Everything Disabled:

(&(objectClass=user)(objectCategory=person)(msExchOmaAdminWirelessEnable=7))

HTH

Chris
0
 

Author Comment

by:AliceGoodspeed
ID: 24735342
Thanks Chris,
I'm almost there. Because now I get everything, even those that dont have an Exchange account aswell. Is there somehow to filter them out with the script?
0
 
LVL 70

Accepted Solution

by:
Chris Dent earned 125 total points
ID: 24735350

Sure, we can use the legacyExchangeDN attribute for that:

(&(objectClass=user)(objectCategory=person)(legacyExchangeDN=*)(|(!msExchOmaAdminWirelessEnable=*)(msExchOmaAdminWirelessEnable=0)))

You might also do the same thing with any of:

mail
homeMDB
proxyAddresses

Chris
0
 

Author Comment

by:AliceGoodspeed
ID: 24735451
I have modified the search and came up with this result.

(&(objectClass=user)(mail=*)(|(!msExchOmaAdminWirelessEnable=*)(msExchOmaAdminWirelessEnable=0)))

IT is working perfect now. Thanks for helping me out Chris,
0
 

Author Comment

by:AliceGoodspeed
ID: 24735467
Chris, whats the difference between my modified and yours. I get 964 accounts while yours gets 977 accounts.
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 24735506

legacyExchangeDN may be set on a few accounts that no longer really have mailboxes. I wondered if you'd get a discrepancy there.

You could probably find them with:

(&(objectClass=user)(objectCategory=name)(!mail=*)(legacyExchangeDN=*))

All those that have legacyExchangeDN, but not mail attribute set.

Chris
0

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now