Monday, 26 February 2007

Export Members of a Distribution List

There are different ways to export members of a Distribution List. You can buy commercial tools, use CSVDE, LDIFDE, DSGET tools or even write you own scripts.

I have found using Outlook itself to retrieve DL members is simple and fast. If you want to directly export the members of a DL to a csv file, LDIFDE is also a good tool to use.
Open Outlook 2003 and create a new email with the address of the DL. Right click on the DL appearing in the address field, and choose Expand DL. Or click on the + sign in front of the DL address. (Figure 1)


Figure 1
If the DL does not expand to show members, you need to unhide the membership in Active Directory Users and Computers snap-in. Right-click the DL, and click Exchange Tasks. Click Next and Unhide Membership,
Then you can copy all the members to a csv or txt file.

LDIFDE is also simple to use. The syntax required looks like this:

ldifde -f export.ldf -d "cn=\distribution group DN" -l member -s server

-f specifies the file name to save the data to.
-d specifies the RootDN (basically where the search starts).
-l specifies what parameter you are interested in (in this case we are looking at the 'member' attribute.)
-s specifies which Active Directory Domain Controller to use.

On a Domain Controller server or your Exchange server, open Command prompt and type in

ldifde -f c:\temp\wildlifeDL.csv –d “cn=\wildlife, ou=Distribution Lists, dc= allabboutexchange, dc=net” –l member

Now go to c:\temp and get your file.

Sunday, 18 February 2007

Exchange 2003 Disaster Recovery by Using Symantec Backup Exec

Before Christmas, an electrician was trying to fix the UPS in our server room. Accidentally, he took the power out and brought down all the servers. We certainly did not appreciate what he did. After the power resumed, I found three stores in a storage group would not mount. Then our service desk was flooded with phone calls. This time, it was a bit hard to send out a notice via email. Here is how you should recover your exchange server if you experience a scenario like this.

1. Confirm all you previous online backups are successful, including last Full backup and then Differential or Incremental backup(s).

2. Run a offline backup of the corrupt database and all transaction logs. This may take a while depending on how big the store is.

3. Ran eseutil and check the State of the database. In this scenario, it should show as Dirty Shutdown.

4. Do not try to run a repair of the database if you have successful backups. Run a restore instead.

This is how you restore the store database from the tape by using Symantec Backup Exec 10.1.

a. On the Exchange server
--- Open Exchange System Manager
--- Right click on the corrupt store and go to Properties
--- Click on Database tag and tick This database can be overwritten by a restore (Figure 1)


Figure 1

b. Open Symantec Backup Exec and choose Restore
--- In Source -- > Selection, choose the store you need to restore
--- In Settings -- > Microsoft Exchange, tick No loss restore (do not delete existing transaction logs) under Exchange 2000 and Exchange 2003
--- Choose a temporary location for log files
--- If it is the last restore set, tick Commit after restore completes. This will allow the transaction logs to be replayed after restore. (In our work scenario, we run a full backup once on the weekend and differential backup every week day. Since the transaction logs will be purged after each full backup, the differential backup will only backup the transaction logs. Therefore, the full backup is the last restore set in this case.) (Figure 2)


Figure 2

c. On the Exchange server
--- Open Exchange System Manager
--- Right click on the corrupt store and go to Properties
--- Click on Database tag and un-tick This database can be overwritten by a restore

d. Re-mount the store.

Now the store should mount. This is not finished yet. You should now run a new online full backup.

Be noted, backing up the corrupt database, restoring and replaying transactions all take time. You should have a detailed disaster recovery plan and always run a fire drill on you test environment once a while.

This outage affected three out of five stores. Some staff members asked why some people could still send and receive email but they could not. Some people even thought it happened because their work was less important than others. Why they think like that? I don't know. Even you explained to them what had happened, they still gave you a suspicious look. My suggestion to you is, always think of something to say before this kind of thing happens.

Good Luck in recovering.