|
|
Question : Query Accounts with Automatically update email addresses based on recipient policy Unchecked
|
|
Is there a way I can query accounts that do not have the following attribute checked on a computer with Active Directory and Exchange?
Automatically update email addresses based on recipient policy found in an accounts properties E-mail addresses tab.
I want to get a list of users that do not have that option checked.
|
Answer : Query Accounts with Automatically update email addresses based on recipient policy Unchecked
|
|
Use adfind from joeware (command-line tool from www.joeware.net) to query on the msExchPoliciesExcluded attribute. Under normal circumstances, this attribute is , so you just need to query for any user object that has a value set for that attribute. (You'll also want to query on any user that has proxyAddresses set to exclude objects that aren't mail-enabled to begin with.)
For example, you can query your whole domain as follows:
adfind -default -f "(&(objectcategory=person)(objectclass=user)(proxyAddresses=*)(msExchPoliciesExcluded=*))"
If you want, you can pipe these results into admod (also from www.joeware.net) to clear the msExch... attribute if that is your end goal. I'm doing this off the top of my head, but the syntax will look something like this: (both adfind and admod have extensive help screens to assist you in producing the syntax you need.)
adfind -default -f "(&(objectcategory=person)(objectclass=user)(proxyAddresses=*)(msExchPoliciesExcluded=*))" -dsq | admod msExchPolicies:-
Hope this helps.
Laura E. Hunter - Microsoft MVP: Windows Server - Networking
|
|
|
|