Solved

Exchange 2007  Queue Database corrupted .que file

Posted on 2016-11-16
1
46 Views
Last Modified: 2016-11-30
Hey there I am hoping to get some clarification on a MS guide I’m following this guide,
https://technet.microsoft.com/en-us/library/bb124343(v=exchg.80).aspx
The transport service kept failing so I backed up and removed the \Exchange Server\TransportRoles\data\Queue folder and restarted the service and it’s been fine. I have a 100mb  mail.QUE  file that I need to process that contains the queue that was causing the crash (I presume).
I am happy with the “Performing a Recovery of the Queue Database by Using Eseutil”, but I get lost at “Preparing the Existing Queue Database on the Target Exchange Transport Server for Replacement by the Recovered Queue Database”. I do not have anything in the queue at current, what effect will this have on my server, and if it does export a bunch of *.EML files what can I do with these files on the server, can I reprocess them? Someone suggested on http://serverfault.com/questions/74003/import-folders-with-eml-files-into-exchange-2007-mailboxes to “Set up an IIS SMTP server and configure it to use your Exchange server as a smart host”

I currently threw this script together to perform the task at hand:
#path 2
#step 1 Move the queue database to a temporary location on the target Exchange transport server.
#step 2 Perform a recovery of the queue database by using Exchange Server Database Utilities (Eseutil.exe).
#step 3 Perform an offline defragmentation of the queue database by using Eseutil.
#step 4 Prepare the existing queue database on the target Exchange transport server for replacement by the recovered queue database.
#step 5 Start the repaired queue database on the target Exchange transport server.
$server = "TAESERVER"
#Eseutil /P (Repair)
$path = "D:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue_old"
$path2 = "D:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue_old2"
if (!(Test-Path $path2)) { mkdir $path2 }
$path3 = "D:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue_old3"
if (!(Test-Path $path3)) { mkdir $path3 }
$que = "D:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue_old\mail.que"
Get-Queue
get-service *exch*
cd $path
Eseutil /r Trn /d. /8
Eseutil /d mail.que
Suspend-Service *MSExchangeTran*
get-service *exch*
Get-Queue
#export current messages we want to save I DO  NOT GET THIS BIT
Retry-Queue -Identity "$server" -Resubmit $True
Retry-Queue -Identity "Unreachable" -Resubmit $True
Get-Message -Queue "Unreachable" | Export-Message -Path "$path2"
#In the Queue Viewer, select the Poison Message queue, select a message, and, in the action pane, select Resume.
Get-Message -Queue "Poison" | ft Identity
Resume-Message <IdentityofPoisonMessage>
Get-Message -Queue "Poison" | Export-Message -Path "$path3"
Retry-Queue “$server” -Resubmit $True
Set-TransportServer -MessageExpirationTimeout <LongerTimeOutIntervalIndd.hh:mm:ssFormat>
#ALL THE WAY TO HERE I GET THIS BIT
#process queue
stop-service MSExchangeTransport
#place old que files in defult directory
start-service *exch*
get-service *exch*
#script End

Please advise on what I can expect from this and any tips that I may need to get this to work and if I am taking the right steps to process the  mail.QUE files/folder.
Thanks, in advance


Windows Server 2008
Exchange 2007
Edition : Standard
AdminDisplayVersion : Version 8.1 (Build 240.6)
que.PNG
que2.PNG
0
Comment
Question by:Joe Danyi
1 Comment
 
LVL 11

Accepted Solution

by:
Tej Pratap Shukla ~Dexter earned 500 total points
ID: 41894122
Hi,
You can defrag mail.que for removing the white spaces. Just follow the steps given below.
1. Know the location of Exchange database. The default location for Exchange 2007 database is
on Hub transport server
C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue

Open in new window

On Edge Transport Server
C:\Program Files\Microsoft\Exchange Server\Bin
After getting at this database location look for the "QueueDatabasePath" and "QueueDatabaseLoggingPath" values.

2. Now stop MSExchange Transfor Server and move the below mentioned file into a different location:

 Mail.que, Trn.chk, Temp.edb, Trn.log, Trnnnn.log, Trnres00001.jrs, Trnres00002.jrs, and Trntmp.log

3. Now restart the MSExchagne Transport Service.

4. Now recover the database. run below mentioned command:
eseutil /d [complete_path_of_moved_location]/mail.que

Open in new window


after successful execution of this command the database would be defragmented.

5. Now reinsert mail.que
Note: After restarting the MSExchange Transport Service a new mail.que file have created, by which mail flow would keep flowing.

run below command to pause the queue:
Net Pause MSExchangeTransport

Open in new window


run this command to make sure whether mail queue is clear or not:
 Get-Queue

Open in new window


run below command to resubmit the old mail.que file

Retry-Queue -Identity "Unreachable" -Resubmit $True

Open in new window



That's it...

Hope your problem would get resolved.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now