Every new version of Exchange Server seems to need more space on a server’s boot drive. Given that, you may be faced with building an Exchange Server and wish you had made the boot partition larger. Once it’s done, though, you can’t always take it back and reconfigure everything. Here, I have some strategies for redirecting drive use from an Exchange Server installed on C: to another, larger data drive.
Note: This article is focused on Exchange Server 2016 on-premise. Newer and older versions of Exchange may act differently.
Moving Base Log Locations
In these examples I’ll use e:\mail\logs as a parent folder bucket (and you’ll see references to it as the destination folder in commands). You’ll see me reference SERVERNAME which is the name of your Exchange Server. I generally also do these steps manually, creating each log destination folder and watching for signs that the server has switched locations. Since there are many logs in Exchange, I don’t suggest you change them all; just go for the ones that consume the most space. 1
Connectivity Logs (PowerShell):
Set-TransportServer SERVERNAME -ConnectivityLogPath “e:\mail\logs\connectivity”
SMTP Receive Logs (PowerShell):
Set-TransportService SERVERNAME -ReceiveProtocolLogPath “e:\mail\logs\smtpreceive”
SMTP FrontEnd Receive Logs (PowerShell):
Set-FrontEndTransportService -Identity SERVERNAME -ReceiveProtocolLogPath “e:\mail\logs\SMTPFrontEnd”
SMTP Send (PowerShell)
Set-TransportService SERVERNAME -SendProtocolLogPath “e:\mail\logs\smtpsend”
Set-TransportService SERVERNAME -QueueLogPath “e:\mail\logs\QueueViewer”
Active User Stats (PowerShell)
Set-TransportService SERVERNAME -ActiveUserStatisticsLogPath
You’ll want to change both the Default Website and The Exchange Back End sites in IIS with this process:
1. Open IIS Manager and select the root of a web site.
2. Double-click on the “Logging” Icon
3. Change the “Directory” path to your large drive location
You could move all files from %ExchangeFolder%\Logging\lodctr_backups to e:\mail\logs\lodctr_backups to free up space (1.2 GB in my case).
WinSxS cleanup (Command Prompt)
Using a lot of data, the WinSxs folder can be problematic. After installing Windows 2012 Server, and finishing updates run the following command :
Dism /Online /Cleanup-Image /StartComponentCleanup
Exchange Setup Logs
I’d suggest moving all c:\ExchangeSetupLogs to e:\mail\logs\ExchangeSetupLogs
Change the text in %ExchangeFolder%\Bin\MSExchangeHMWorker.exe.config referenced by “DefaultTraceLogPath” to a location on the data drive. Something like value=”e:\mail\logs\TraceLogs”. The server has to be rebooted for this one.
Change the EdgeTransport Queue Path (to prevent “452 4.3.1 Insufficient system resources” errors)
Change text in %ExchangeFolder%\Bin\EdgeTransport.exe.config to include the desired path at this line item: <add key=“QueueDatabasePath” value=”e:\mail\QueueDB\” />. A reboot is required for this change also.
Change Location of Event Logs
The event logs can easily eat up many gigabytes, so moving some of these will save you space. There are a couple strategies for this, but I share what worked for me:
1. Create a folder on the drive with space, say e:\winevt
2. Ensure that the folder is writeable by the account running the Event Log service (usually LOCAL_SERVICE)
3. Open the Event Log Viewer and find the specific event log.
4. Right-click on that log branch and choose “Properties”
5. Replace the text of “Log Path” with the full path and filename of the logfile. SOmething like this: e:\winevt\application.evtx
Note: The change takes place immediately.
As there are many logs, you’ll not want to change them all, but here are a few I targeted: Setup, System, Application, Security, Microsoft-Exchange-ActiveMonitoring (MaintenanceDefinition, MaintenanceResult, MonitorDefinition, MonitorResult, ProbeDefinition, ProbeResult, ResponderDefinition, ResponderResult)
Daily Performance Logging
I found a way for this one – the biggest culprit. The answer is a compromise that you might not be willing to make because you’ll look functionality. I have not yet found a way to redirect the logs to a new location. Rather, you have to stop the service from running.
1. Open Task Scheduler and find \Microsoft\Windows\PLA
2. Stop and disable both ExchangeDiagnosticsDailyPerformanceLog and ExchangeDiagnosticsPerformanceLog
3. Move any files left over in the folder %ExchangeFolder%\Logging\Diagnostics\DailyPerformanceLogs
4. You might also want to disable the Exchange Health Manager service, but I’d leave at this point.
I noted previously a number of ways to move logs in Exchange 2013 with commands like:
Set-TransportService -Identity SERVERNAME logman -stop ExchangeDiagnosticsDailyPerformanceLog
Set-TransportService -Identity SERVERNAME logman -update ExchangeDiagnosticsDailyPerformanceLog -o “e:\newpath”
Set-TransportService -Identity SERVERNAME logman -start ExchangeDiagnosticsDailyPerformanceLog
Unfortunately, they do not appear to work on Exchange 2016. I don’t find anything out there that explains how this is possible now (or why Microsoft removed the ability to do so).
That’s enough to start with. It’s by no means the full list of logging locations that can change, but it should offload a great deal of space from the boot drive while Exchange runs. I don’t suggest moving the pagefile, but if you still need space, that could get you some too. If you too are working with this, I’d love to hear what you’ve learned too.
I'd love to hear about any you might of moved that could be smart for a new server install. ↩