Skip to main content

The UnifiedContent folder in Exchange Server is increasing. After looking into it, it’s temporary files filling up the folder. Shouldn’t these files clear automatically? The answer is that it should. In this article, you will learn the solution to Exchange UnifiedContent folder keeps growing.

Why UnifiedContent folder grows

Exchange Server creates and manages temporary files in the UnifiedContent folder to assist antimalware scanning. Although the Microsoft Exchange Health Manager service runs a scheduled cleanup task on that folder, either of the following scenarios can cause the cleanup to fail:

  1. Move mail queue to another location in Exchange Server
  2. Didn’t install Exchange Server in the default location

The default location of the UnifiedContent folder is:

C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp\UnifiedContent

In our case, the UnifiedContent folder is in the below location because we moved the mail queue to the (Q:) drive.

Q:\TransportRoles\data\Temp\UnifiedContent

The UnifiedContent folder has been filling up with files since then.

Exchange UnifiedContent folder keeps growing before

Cleanup UnifiedContent with PowerShell script

Many ask if they should create a script that will run every day or week to clear up these files or to edit the Cleanup logs Exchange 2013/2016/2019 PowerShell script and add this folder path to it.

Yes, you can. But that’s not the cleanest approach because the Microsoft Exchange Health Manager service should run every couple of hours and clean up that folder.

Let’s have a look into that in the next step.

Solution to UnifiedContent folder filling up

To change the UnifiedContent folder path in Antimalware.xml, follow the below steps:

Important: Do this on every Exchange Server.

1. Start File Explorer

2. Go to the UnifiedContent folder.

In our example, the location is in the (Q:) drive:

Q:\TransportRoles\data\Temp\UnifiedContent
Exchange UnifiedContent folder keeps growing copy folder path

3. Open the Antimalware.xml settings file

In our example, it’s in the default location:

C:\Program Files\Microsoft\Exchange Server\V15\Bin\Monitoring\Config
antimalware.xml settings file

4. Search for the following path:

C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp\UnifiedContent

5. Replace it with the path you copied from step 2.

Q:\TransportRoles\data\Temp\UnifiedContent
Exchange UnifiedContent folder keeps growing edit location

6. Save the file.

Note: You don’t have administrator access if you can’t save the file. Start Notepad as administrator and open the Antimalware.xml settings file so you can adjust the location and save the file.

7. Restart the Exchange Health Manager service.

Restart Microsoft Exchange Health Manager service

Exchange Health Manager will clean the UnifiedContent folder during the next maintenance cycle. By default, maintenance cycles run every 4 hours.

Verify UnifiedContent folder is cleaned

Check the UnifiedContent folder after 4 hours. Verify that the temporary files of the last days are available and all the older files are cleaned up.

Exchange UnifiedContent folder keeps growing copy folder path

That’s it!

Leave a Reply