Google
Search WWW Search msexchangetips.blogspot.com

Wednesday, May 09, 2007

Exchange: DSQUERY Is Your Friend

Summary: Dsquery is a powerful search command tool that can help you find users, or users with certain attributes. Below are some sample searches to give you an idea of how to use dsquery and it's syntax.


Example 1.

In this example, I want to find to export objects and who has ownership. For example, I want to find the owners of distribution lists that they can manage.

C:\Documents and Settings\JamesMVP>dsquery * -limit 200000 dc=corp,dc=mycompany,dc=com -filter "(&(objectclass=*)(objectcategory=*))" -attr displayname managedby > c:\managedby.txt


Example 2.

In this example, I want to list all users that are in a certain mailbox store using the homemdb attribute.

C:\Documents and Settings\JamesMVP>dsquery * dc=corp,dc=mycompany,dc=com -filter "(&(objectclass=user) (object category=person)(homemdb=CN=Mailbox Store (EX3),CN=First Storage Group,CN= InformationStore,CN=EX3,CN=Servers,CN=First Administrative Group,CN=Admini strative Groups,CN=DSTTEST,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC =corp,DC=company,DC=local))" -attr displayname > c:\mailboxes.txt


James Chong (MVP)
MCSE M+, S+, MCTS, Security+
msexchangetips.blogspot.com
ftp://ftp://ftp.smtp25.org//

How useful was this article? Want to see a tip not listed? Please leave a comment.

Monday, May 07, 2007

Exchange: BCP Planning Exchange 2003

Summary: Business continuity planning for Exchange 2003 using standby server. Many users ask how to have a standby server in the event that their Exchange server fails. Other than using third party application replication software, the only method is to perform the empty mailbox method (dial tone) on your standby server. This basically involves moving your mailboxes to the standby server by changing serveral Exchange related attributes. Because your primary server is down, you cannot move the mailboxes using Exchange System Manager, therefore you will have to manually update the attributes which a move mailbox would perform. With Exchange 2007, this is easier with Log Shipping technology.

MS has an article "How to Re-Home Exchange Mailbox Account"
http://technet.microsoft.com/en-us/library/bb124766.aspx

While testing the steps in this article there were several issues that were noted. This article will go over these steps to test the re-homing of your mailboxes. This article will also go over using ADmodify to re-home mailboxes as well.


Note: After users have been re-homed to a test server, they must create a new profile. This is because their existing profile will continue to point to the down server and will not re-direct them to their new server. Users also have the option to work via OWA.


Method 1 Using LDIFDE

1. Open command prompt and export the following Exchange attributes from the users in the failed Exchange server. Replace homeMDB with the DN of the server that failed. You can retrieve the DN by going into adsiedit.msc

2. This must be performed for every database on the Exchange server that failed. If there are 8 databases, this will need to be run 8 times changing the homeMDB attribute to each individual database.

C:\>ldifde -f export.txt -d "dc=corp,dc=etradegrp,dc=com" -l msexchhomeservern
ame,homemdb,homemta -r "(&(objectclass=user)(homeMDB=CN=Mailbox Store 08 (ATL1EX11),CN=Third Storage Group,CN=InformationStore,
CN=ATL1EX11,CN=Servers,CN=UnitedStates,
CN=Administrative Groups,CN=MyOrgInc,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=corp,
DC=Mydomain,DC=com))"


3. Open the export.txt file and copy contents into MS word. Replace the following on the left column with the right column.


dn: [replacewith] -^pdn:
changetype: add [replacewith] changetype: add
homeMTA [replacwith] replace: homeMTA^phomeMTA
homeMDB [replacewith] -^preplace: homeMDB^phomeMDB
msExchHomeServerName [replacewith]
-^preplace: msExchHomeServerName^pmsExchHomeServerName

[name of original database] replacewith [name of new database]
[name of original storage group] replacewith [name of new storage group]
[name of original server] replacewith [name of new server]


Sample Input LDF File after replacing 8 objects above should resemble formatting below. (Ensure there is a line space from ending of one user object to beginning of new user object. Remove mailboxes for SMTP connector, System Attendant and System Mailbox prior to importing file in step 3. Replace the name of original db, storage group and original server with new names.

dn: CN=Chong\,MVP,OU=HQ,DC=Corp,DC=lab,DC=local
changetype: modify
replace: homeMTA
homeMTA:
CN=Microsoft MTA,CN=DEVEX2,CN=Servers,CN=First Administrative Group,CN=Admi

nistrative Groups,CN=DSTTest,CN=Microsoft Exchange,CN=Services,CN=Configuratio
n,DC=dsttest,DC=etrade,DC=local
-
replace: homeMDB
homeMDB:
CN=Mailbox Store (DEVEX2),CN=First Storage Group,CN=InformationStore,CN= DEVEX2,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=DS
TTest,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=corp,DC=lab,
DC=local
-
replace: msExchHomeServerName
msExchHomeServerName:
/o=DSTTest/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=DEV
EX2
-

dn: CN=adm-Chong\, James,OU=EnterpriseServices,DC=corp,DC=lab,DC=local
changetype: modify
replace: homeMTA
homeMTA:
CN=Microsoft MTA,CN=DEVEX2,CN=Servers,CN=First Administrative Group,
CN=Administrative Groups,CN=corp,CN=Microsoft Exchange,CN=Services,
N=Configuration,DC=corp,DC=lab,DC=local
-
replace: homeMDB
homeMDB:
CN=Mailbox Store (DEVEX2),CN=First Storage Group,CN=InformationStore,CN= DEVEX2,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=DS
TTest,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=corp,DC=lab,
DC=local
-
replace: msExchHomeServerName
msExchHomeServerName:
/o=DSTTest/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=DEV
EX2
-


4. Import File LDIFDE –I – F

5. Open ADUC, open an account for a user that resided on the down Exchange server. Click the Exchange General tab. Verify that the mailbox location now points to the new location.

6. Open user mailbox. Must create a new Outlook profile or choose to use OWA. Mailbox will not show in ESM until user has opened Mailbox in Outlook.

7. Once the original database has been restored to the original server, re-rerun the script to re-home the user’s mailboxes back to the original server.

8. Perform Exmerge on the temporary Exchange server to extract the .PST files. Re-run exmerge in merge mode to merge the new e-mails with the old mailbox.



Method 2 ADMODIFY Utility


Execute admodify. You can download this from MS. Ensure that the application is run with admin privileges

Proceed with the following instructions:


Modify Attributes

Domain List = DC=corp,DC=lab,DC=com


Domain Controller List = dc.corp.lab.com

Show Only = Users


Domain Tree List = Advanced Features, Show Containers Only


Click Custom Ldap Query

Click green arrow. You should now see corp in the white page, highlight this

LDAP Filter = (&(objectclass=user)(homeMDB=CN=Mailbox Store 08 (EXCH1),
CN=Third Storage Group,CN=InformationStore,CN=EXCH1,CN=Servers,
CN=UnitedStates, CN=Administrative Groups,CN=MyorgInc,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=corp,DC=lab,DC=com))


Click Add to List. Will take about 3-5 minutes to generate query

Once items have been enumerated. Highlight all items while removing any system mailboxes, ie. SMTP mailbox. Click next

Click Exchange General Tab, check, set homeMDB drop down box. (Note select this option before Set homeMTA. There appears to be a bug in which the list will not enumerate if this option is chosen second) Choose the temporary Exchange server. No set homeMTA and choose the same temporary Exchange server and click Go button.



James Chong (MVP)MCSE M+, S+, MCTS, Security+
msexchangetips.blogspot.com
ftp://ftp://ftp.smtp25.org//
How useful was this article? Want to see a tip not listed? Please leave a comment.
xml:lang="en" lang="en"> MS Exchange Tips: May 2007