Exchange 2013 space issues

Space seems to have been eaten alive on my exchange server....don't have the option to extend the volume, or add more space at the moment....year end and all....It has just gone.

Last week I did a mailbox delete of an old user....20gb (don't ask) I figured this would help my issue...not one byte was freed up.  Ran a manual backup, thinking the logs where to blame, nope, not one byte changed.  Now I am getting worried.

mail.que is over 2gb, and I have a bucket of files all over the flippin place.  The exchange database is at 291,xxx,xxx and change.  There are dozens more .dat files....the ones pictured are only the really big ones.

I am getting a bit worried they said in pulp fiction I am in the red....and you know what they say about a race car in the red.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The Mailbox EDB file is the biggest one that you should have solved. But that's only possible if the SAME space is available somewhere (an extra 300GB)
Deletion and moving will never free up space. Only a full move to a new database will. That's where you need the extra space for.
In your case, if the database file was half, you would have enough space to "shrink" the database.
Right now, you should schedule a weekend, to do a full database move to a USB hard disk (with 300GB free space), and after it's successfully working, move it back to the original location (delete the original database file).
Then you will see it's shrunken (depends on how many deleted things were keeping the space so high, if you just deleted 50 GB of mailboxes, the resulting database file will be around 250 GB)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott CSenior EngineerCommented:
Here are my notes on moving Logging on Exchange 2013.  See if this will help you.

Move Logging in Exchange 2013 via Powershell

Tuesday, June 30, 2015
10:56 AM

Exchange 2013 has drastically increased the amount of logging that happens by default.   So much so that the suggested free space for the install of 2013 on the C: drive is now up to 30 GB.    Much of this space is due to the size of the log files.      In the past the best practices for installing exchange were to move logging onto its own partition (or even better) its own drive.    With the introduction of 2013, this is a tedious task because of the number of logs involved with each of the roles.

Problem with the current default configuration is that it is wasteful and creates several issues that an administrator must deal with:
      • Placing log files that constantly grow and recreate themselves on the same partition as the OS creates fragmentation
      • Having 30GB or more of extra space may require you to purchase larger disks for your OS volume.  For example, I always use SSD drives for the OS volume.  I don't want to pay for log files to sit on expensive SSD storage.
      • Backup requirements for my OS volume are not the same as my requirements for less critical data like log files.   I may want to backup the OS volume daily and log files less often or not at all.  Having them on the same volume makes the configuration of the backup job more complicated.
      • Increasing the longevity of the log files can easily consume even well planned volumes.
Unfortunately, I can only find a way to move about 1/3 of the log files that exchange creates.   The other 2/3 seem to be unconfigurable.  I would welcome anyone to edit this WIKI or comment if they can find a way to move more of the logs.
While you can move a few of the log files with the GUIs, it is probably better just to do them all at once using Powershell.  I usually create a volume for my log files and label it as drive L:.  So in my scripts, you will see everything is going to be moved to the same folder tree it originally resided on but in a different drive.  I will say without hesitation that i am not an expert in PowerShell.   My script is very basic and I am sure that someone more skilled in PS would be able to spruce it up by inserting more variables or other bits of fancy code.   This script does not move the existing log files to a new location.  It only moves future log files.   Existing log files are left alone.

The writer cannot be held responsible for any different output from the script  Use it at your OWN RISK. If you are not aware with logic of code don't use it please..

# ------------------------
# MoveEX2013logs.ps1
# ------------------------
# Version 1.0 by KSB
# This script will move all of the configurable logs for Exchange 2013 from the C: drive
# to the L: drive.  The folder subtree and paths on L: will stay the same as they were on C:
# Get the name of the local computer and set it to a variable for use later on.
$exchangeservername = $env:computername
# Move the standard log files for the TransportService to the same path on the L: drive that they were on C:
Set-TransportService -Identity $exchangeservername `
-ConnectivityLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Connectivity" `
-MessageTrackingLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\MessageTracking" `
-IrmLogPath "L:\Program Files\Microsoft\Exchange Server\V15\Logging\IRMLogs" `
-ActiveUserStatisticsLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ActiveUsersStats" `
-ServerStatisticsLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ServerStats" `
-ReceiveProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive" `
-RoutingTableLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Routing" `
-SendProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpSend" `
-QueueLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\QueueViewer" `
-WlmLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\WLM" `
-PipelineTracingPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\PipelineTracing" `
-AgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\AgentLog"
# move the path for the PERFMON logs from the C: drive to the L: drive
logman -stop ExchangeDiagnosticsDailyPerformanceLog
logman -update ExchangeDiagnosticsDailyPerformanceLog -o "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\DailyPerformanceLogs\ExchangeDiagnosticsDailyPerformanceLog"
logman -start ExchangeDiagnosticsDailyPerformanceLog
logman -stop ExchangeDiagnosticsPerformanceLog
logman -update ExchangeDiagnosticsPerformanceLog -o "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\PerformanceLogsToBeProcessed\ExchangeDiagnosticsPerformanceLog"
logman -start ExchangeDiagnosticsPerformanceLog
# Get the details on the EdgeSyncServiceConfig and store them in a variable for use in setting the path
# Move the Log Path using the variable we got
Set-EdgeSyncServiceConfig -Identity $EdgeSyncServiceConfigVAR.Identity -LogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\EdgeSync"
# Move the standard log files for the FrontEndTransportService to the same path on the L: drive that they were on C:
Set-FrontendTransportService  -Identity $exchangeservername `
-AgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\AgentLog" `
-ConnectivityLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\Connectivity" `
-ReceiveProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive" `
-SendProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpSend"
# MOve the log path for the IMAP server
Set-ImapSettings -LogFileLocation "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Imap4"
# Move the logs for the MailBoxServer
Set-MailboxServer -Identity $exchangeservername `
-CalendarRepairLogPath "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Calendar Repair Assistant" `
-MigrationLogFilePath  "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Managed Folder Assistant"
# Move the standard log files for the MailboxTransportService to the same path on the L: drive that they were on C:
Set-MailboxTransportService -Identity $exchangeservername `
-ConnectivityLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\Connectivity" `
-MailboxDeliveryAgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Delivery" `
-MailboxSubmissionAgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Submission" `
-ReceiveProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpReceive" `
-SendProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpSend" `
-PipelineTracingPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\PipelineTracing"
# MOve the log path for the POP3 server
Set-PopSettings -LogFileLocation "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Pop3"

Once you have completed moving the logs as shown above,  would recommend you restart the server. 

If you had the server running for a while with the default logging locations and you want to clean up the old log files that you just redirected then you can run the script below to remove the old folders and files from the C: drive and reclaim some of your free space.  

BELOW SCRIPT DELETES FILES!!! I am not responsible if you damage your server with my scripts.  Use them at your OWN RISK.  If you don't understand what they are doing, DO NOT USE THEM.
# ------------------------
# RemoveEX2013logs.ps1
# ------------------------
# Version 1.0 by KSB
# This script will delete the folders and files for the log files that have been redirected away from C:
# This will not work unless you have rebooted the server after moving the log files already.
# Delete the old log files that we just moved
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Connectivity" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\MessageTracking" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\IRMLogs" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ActiveUsersStats" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ServerStats" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Routing" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpSend" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\QueueViewer" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\WLM" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\PipelineTracing" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\AgentLog" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\EdgeSync" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\AgentLog" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\Connectivity" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpSend" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Imap4" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Calendar Repair Assistant" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Managed Folder Assistant" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\Connectivity" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Delivery" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Submission" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpReceive" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpSend" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\PipelineTracing" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Pop3" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\DailyPerformanceLogs\" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\PerformanceLogsToBeProcessed\" -force -rec

From <>
Scott CSenior EngineerCommented:
Also, you are backing up Exchange correct?  Only a FULL backup will purge log files.  I've seen it before when Exchange isn't getting backed up, log files aren't getting deleted and space is getting eaten alive.
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

Scott CSenior EngineerCommented:
It's not a good idea to have your database and mail.que on the same drive.

See if you can move the mail.que to a different drive...NOT the C drive of course.  That will give you some breathing room.
Scott CSenior EngineerCommented:
Here is how to reduce the size of your mail.que file....though yours isn't that large.

Large mail.queue size

Monday, April 13, 2015
4:12 PM

Here is the information I mentioned regarding larger Mail.que database on Exchange 2013 versus 2007/2010.
As mentioned, this large mail.que growth is normal, due to new features in Exchange 2013, specifically SafetyNet and Shadow Redundancy
Due to these features, the transport's Queue database size needs to be high.
This article will provide further detail on SafetyNet:
These articles will also provide further detail of size calculating:
(See section: “Transport storage requirements”)
Our primary recommendation is to of course plan for large volumes, or increase the volume size, as you already have.
Else, a proposed workaround is to Decrease value of SafetyNetHoldTime  and MessageExpiration to reduce the growth of mail.que.
If at any time the mail.que size goes beyond 100 GB, then, considering the total disk capacity of 200GB for the drive, we have to reduce the SafetyNetHoldTime and MessageExpirationTimeouton values to one day (default values are 2 days). For this we need to run below commands:
Set-TransportConfig SafetyNetHoldTime 1.00:00:00
Get-TransportService | Set-TransportService -MessageExpirationTimeout 1.00:00:00

To get rid of large queue file:

1.  Pause Transport Service
2.  Let queues empty out
3.  Stop Transport Service
4.  Set Transport Service to "Disabled"
5.  Rename/Move/Delete mail.queue file
6.  Set Transport Service to "Automatic"
7.  Start Transport Service
CCSO691Author Commented:
A bunch of great suggestions....I have two more drives on order so I am going to setup another volume and move the database over there....this will do what several suggested....have the que on one "drive" and the database on the other.

I would like to keep this open till the new hardware gets here......It is like everything here....stuff grows and grows.
So just to be clear, when you have the new volume, don't just move the database, it will be the same size.
You create a new database on the new volume, and do mailbox-moves for all the mailboxes. Only then will the new mailbox store be smaller (if in fact it's big because of deleted data)
Scott CSenior EngineerCommented:
Just remember that the deleted space is "white space" while the DB will be the same size, as new messages come into the DB, they will be placed in that "white space".  Then when/if the white space is used up, only then will your DB start to grow again.
CCSO691Author Commented: I make a new database, then move the mailboxes over to the new database....I assume I could do this a few mailboxes at a time to lessen the impact on my users?

Then, to make sure I understand this....I move john doe's mailbox he had a mailbox that was 20gig, but I went in and deleted everything, after the move that mailbox is still going to take up 20gb of space?
Depending on retention rules, it might still be 20 GB. If retention is all past, like you deleted 10GB of data 2 months ago (and retention was set at 30 days), the resulting mailbox takes 10GB of space.
CCSO691Author Commented:
Understood, We are a 24x7x365 deal so I really can't do them all at the same time.....and the retention is all set and I can't change that, we are the guberment and unlike some we have to follow the laws of the land.

Drives are on the way....I was thinking about sending out a note to tell people to clean up their mailboxes if they can, but sounds like it is not going to help.  Is stuff in the "trash can" subject to the same retention rules?  You know how people are....the delete it out of the inbox and think that really kills it....would telling everyone to empty the trash help in the transfer.

Thanks soon as the new parts get here I am sure I will have more questions.
Deleted Items has its own retention policy you can set.
Seth SimmonsSr. Systems AdministratorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

-- Kimputer (https:#a42390992)
-- Scott C (https:#a42391061)
-- Scott C (https:#a42391063)
-- Kimputer (https:#a42399792)
-- Scott C (https:#a42391066)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.