Page 1 of 8
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
Page 2 of 8
You need a filter to find all objects that are in Dallas or Austin, and that have the first name of John. This
would be:
(&(givenName=John)(|(l=Dallas)(l=Austin)))
You have received 9,548 events in the Application log, and you need to find all of the objects that are
causing this logging event. In this case, you need to find all of the disabled users
(msExchUserAccountControl=2) that do not have a value for msExchMasterAccountSID. This
would be:
(&(msExchUserAccountControl=2)(!msExchMasterAccountSID=*))
Note:
The ! operator in conjunction with the wildcard operator will look for objects where that attribute is not set
to anything.
3. Click the drop-down list next to Find, and then select Custom Search.
4. From the next screen, select the Advanced tab.
5. Type the appropriate LDAP statement under Enter LDAP query.
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
Page 3 of 8
This example attempts to find all objects that either have prez for their title or test for the start of their name. If
you click Find Now, you should see the appropriate output, as shown in the following screenshot.
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
Page 4 of 8
A dialog box appears that should have the correct value in the Base DN field. Type the LDAP statement that you
want to filter by, and something similar to the following should appear.
If you want to search all of the containers below the level you are currently at, make sure to select the option
button for Subtree. Click Run, and it should find all of the matches.
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
Page 5 of 8
C:\>ldifded"DC=witaylorroot,DC=com"fc:\output.txtr"(&(objectClass=user)(mailNickName=jeff*))
In this example, you would find three objects and export all of their attributes into the output .txt file that you
specified. If you are exporting the results for thousands of users, however, the export file will be too large. There
is a different option. You can use the -l (lowercase L) switch to specify which attributes to export. The
distinguished name will always export, but if you want nothing else, you can add -l nothing to the string, and
that would streamline the output. An example of this is the following command.
C:\>ldifded"DC=witaylorroot,DC=com"fc:\output.txtlnothingr"(&(objectClass=user)(mailNickName
=jeff*))
Consider that in this case, you want to use the LDIFDE export referenced earlier, but only want to include the
homeMDB attribute in the output. You must use the following command.
C:\>ldifded"DC=witaylorroot,DC=com"fc:\output.txtl"homeMDB"r"(&(objectClass=user)(mailNickNa
me=jeff*))
dn:CN=jeff,OU=55Users,DC=witaylorroot,DC=com
changetype:add
homeMDB:
CN=PrivateInformationStore(WITAYLORNT4EX55),CN=FirstStorageGroup,CN=InformationStore,CN=WITAYLORNT4
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
Page 6 of 8
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
Page 7 of 8
If you click the Advanced button, the Custom LDAP Filter dialog box appears. In this dialog box, you type the
LDAP filter that you want to use. In this example, you only want to list the groups that are mail-enabled. It would
look like the following.
Next, click OK. Select the OU or the domain where you want ADModify to search. If you want it to look in lower-level
containers within the one you selected, make sure to select Traverse Subcontainers when Enumerating Users.
Click Add to List, and then click Yes when warned about how long it could take. The objects that meet the criteria
you specified should now appear in the right pane.
From here, highlight the objects that you want to modify, and continue with the wizard.
Links Table
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012
http://go.microsoft.com/fwlink/?LinkId=41364
http://workspaces.gotdotnet.com/ADModify
http://go.microsoft.com/fwlink/?linkid=3052&kbid=255602
http://go.microsoft.com/fwlink/?linkid=3052&kbid=296112
Page 8 of 8
Community Content
Logical OR
the logical OR opperator is "|" as shown in this example:
(&(givenName=John)(|(l=Dallas)(l=Austin)))
12/3/2010
fran_bsas
http://technet.microsoft.com/en-us/library/aa996205(d=printer,v=exchg.65).aspx
5/14/2012