Tuesday, June 14, 2011

Dsquery to find a email address in AD

dsquery * domainroot -filter "((proxyaddresses=*domain.com))" -scope subtree -attr displayname

* - to Find any object class user,group etc
domainroot - Where to search 
-filter - What to search
-scope - At what level base or subtree it has to search
-attr - what attributes needs to be displayed with the filtered results


Monday, June 13, 2011

Enumerate members of a group directly from Active directory custom search

This command will be useful particulerly if you are migrating large number of users to an other exchange server. Add all the members to migrate to this group and enumerate using the below command from dsa.msc, add Homemdb members column. There are other ways (Scripting, powershell etc) but i find this easier.


(ObjectClass=User)(
ObjectCategory=Person)(memberOf=CN=TestGroup,OU=Test-Service Acct,dc=,dc=,dc=com)

Dont forget to fill in the DC names :)