Disaster Recovery of Exchange 2007 Mailbox Server

If you are running in an environment where there is High Availability options like LCR or CCR or SCR step for the exchange mailbox then we need to make sure that you have at least Daily full backups on the Exchange 2007 Servers

 

Below are the some of the situation where you wanted to go for new Hardware

 Your hardware has failed

You are performing a dial-tone recovery, where Active Directory is intact

You are performing a site recovery, where Active Directory is intact

When migrating a Client Access server, Hub Transport server, Unified Messaging server, or Mailbox server to new hardware

 Steps to approach recovery of Exchange 2007 Mailbox Server

 

  1. Search for the Crashed mailbox server from the active directory users and computer and right click on the same and click on Reset
  2. Install same windows version on the new box with same service pack and hot fixes with same name of the Crashed Exchange 2007 mailbox server with the same IP address of the old machine. If IP address is changed then you may need to updated DNS
  3. Allocate the storage on the new server which matches the older server
  4. Install Exchange 2007 using command “Setup /M:RecoveryServer
  5. Install all the hotfix and rollup updates
  6. Create all the Required Storage groups and stores in the same naming standard
  7. Restore all the Database stores with options “This Database can be over written by restore”
  8. Mount the databases
  9. You can create the new public store and check if the replication is configured properly and allow public folders to get replicated from other public folder stores
  10. Then you may rebuild full text Index catalog. Index catalog helps to search for the documents and attachments in the messages. Index Catalog is for each Storage group
  11. Document helps to rebuild Search Index

http://technet.microsoft.com/en-us/library/aa995966.aspx

Powershell to get Mailboxes lists who’s Mailbox Quota limits is not get as Default

For various reason we increase the mailbox of the user  or reduce from the default size which is applied throught mailbox store policy. If you want to get the list of users who is not set to default Quota limits. Below command helps you to get the same

Get-Mailbox -ResultSize unlimited |Where{($_.UseDatabaseQuotaDefaults -eq $false)}

Below command gets you the list of mailbox who Quota limits is not get set as default in a given Exchange sever

Get-Mailbox -ResultSize unlimited |Where{($_.UseDatabaseQuotaDefaults -eq $false) -and ($_.Servername -eq “<servername>”)}

Below command to get the list of mailbox who quota limit is get set as default in a given Exchange Store

Get-Mailbox -ResultSize unlimited |Where{($_.UseDatabaseQuotaDefaults -eq $false) -and ($_.Database -eq “servername\SG\Store”)}

Exchange 2007 Self-Signed Certificate

Exchange 2007 will issue Self-Signed to all except Mailbox Server. Self-Signed certificates are only valid for one year.
Below command helps to create Self-Singed for SMTP TLS connection. You can use the below command when you get this error in transport server

“The STARTTLS certificate will soon expire. The STARTTLS certificate is the certificate not used for internal TLS applications” Event id :12023

 

New-ExchangeCertificate -PrivateKeyExportable $TRUE -SubjectName “CN=servername” -DomainName FQDNservername |Enable-ExchangeCertificate -Services SMTP

 

Below command help to renew the exisitng self-signed certificate to next one year from the date of running this command

 

Get-ExchangeCertificate | New-ExchangeCertificate

Powershell to Customize Exchange 2007 Online Maintenance

Powershell to customize online maintenance schedule. During this interval, tasks like dumpster cleanup (the deletion of messages that have passed their deleted item retention date), deleted mailbox cleanup, and online defragmentation (database objects that are no longer being used are detected and removed, thereby making additional database space available) are performed. These processes keep the Exchange Server computer healthy and the performance stable. Online maintenance should be set to run at least four hours a day; failing to do so will cause performance degradation over time.

Get-MailboxDatabase | Set-MailboxDatabase -MaintenanceSchedule “Sun.1:00 PM-Sun.5:00 PM”,”Mon.1:00 PM-Mon.5:00 PM”, “Tue.1:00 PM-Tue.5:00 PM”, “Wed.1:00 PM-Wed.5:00 PM”,”Thu.1:00 PM-Thu.5:00 PM”, “Fri.1:00 PM-Fri.5:00 PM”,”Sat.1:00 PM-Sat.5:00 PM”

Exchange 2007 Mailbox Rentention policy

Modifying Mailbox Rentention policy on Exchange 2007 Server Stores. By default mailbox retention policy of Exchagne 2007 Store is 30 days. you can modify this as per the requirement.  Below command helps to modify all the store

Get-Mailboxdatabase | Set-MailboxDatabase -MailboxRetention 10

Below command will set the Mailbox retention policy on the specified exchagne server to 10 days

Get-Mailboxdatabase | |?{$_.ServerName -eq <servername>} | Set-MailboxDatabase -MailboxRetention 10

Exchange 2007 Mailbox Setting Configuration Information updation Interval

All Mailbox Settings are stored in Active directory and once you make changes like Storage Quota limits etc it will take 2 hours to reflect for the user. This is because Exchange Cache active directory information every 2 hours. This is known has Mailbox Cache Age Limit. We can change registry settings to reflect the Mailbox settings (Storage) ASAP.  Recommended modification to keep Mailbox Cache Age limit to 1 hour from 2 hours and its also not recommended to limit less then 20 Min

Details description of the registery settings is describited in the below mentioned site

http://technet.microsoft.com/en-us/library/bb684892.aspx

  1. Start the registry editor on your Exchange 2007 Mailbox server
  2. Locate the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem key.
  3. Create the “Reread Logon Quotas Interval” value
    1. Right-click ParametersSystem, select New, and then select DWORD value.
    2. Name the new DWORD value “Reread Logon Quotas Interval”.
    3. Right-click Reread Logon Quotas Interval, and then click Modify.
    4. Enter a decimal value of 1200 seconds (20 minutes)
  4. Create the “Mailbox Cache Age Limit” value
    1. Right-click ParametersSystem, select New, and then select DWORD value.
    2. Name the new DWORD value “Mailbox Cache Age Limit”.
    3. Right-click Mailbox Cache Age Limit, and then click Modify.
    4. Enter a decimal value of 20 (20 minutes)
  5. Locate the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchange ADAccess key.
  6. Create the “CacheTTLUser” value
    1. Right-click MSExchange ADAccess, select New, and then select Key.
    2. Name the new key Instance0.
    3. Right-click Instance0, select New, and then select DWORD value.
    4. Name the new DWORD value “CacheTTLUser”.
    5. Right-click CacheTTLUser, and then click Modify.
    6. Enter a decimal value of 300 (5 minutes)
  7. Restart Information Store service to bring the change in Effect Immediately on all the Mailbox store server.

Deleting Disconnected mailboxes from Exchange 2007

By default deleted mailbox retention policy is 30 days and after that deleted mailboxes will be disconnected state for next 30 before its actually gets deleted off the store

Below powershell to get the list of all the users on the specific Exchange server who disconnected mailbox older than 10 days, you can modify the days based on your requirement into the variable $disconnectedUsers

 

$DisconnectedUsers = Get-MailboxStatistics -Server <servername> | where-object { $_.DisconnectDate -ne $null } | ?{$_.DisconnectDate -lt (get-date).AddDays(-10)} | Select DisplayName,Database,MailboxGuid

 

Below command will get the users from variable $DisconnectedUsers one by one in the for loop and delete the same

$DisconnectedUsers | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

Powershell to create Mass Mailboxes in Exchange 2007 from CSV input file

Powershell to create the Mass mailboxes in Exchange 2007 orginisation from CSV input file. Below is the CSV file format which need to have the following header and details in the below mentioned format

Csv Format
Firstname, Lastname,Aliasname,Database,OUPath
Krishna, kumar,krishnakumar,server\storagegroup\store,Users

 

Below is the powershell script to create the mass mailbox by reading the csv file and and create the mailbox. First it take the password as input and reads the csv file and create the mailbox with the information in the csv file

 
$Password=Read-Host “Enter Password” -AsSecureString
Import-CSV C:\CreateNewmailbox.csv |
foreach {
$userprincipalname = $_.Firstname + “.” +  $_.Lastname + “@domain.com”
new-mailbox -name $_.name -alias $_.alias -FirstName $_.Firstname -LastName $_.Lastname -userPrincipalName  $userprincipalname -database $_.Database -OrganizationalUnit  $_.OUpath -Password $Password
}