skip to Main Content

Remove old Exchange OWA files to free up disk space

You want to free up disk space on the Exchange Server. After doing a scan on the Exchange Server, you find more than a couple of GB’s in the Exchange Owa\prem folder. It can even take up more than 10 GB in size. The question is, can you remove these old Exchange OWA files?

Keep your Exchange Server up to date for new features, bug fixes, and security fixes. After every Exchange Cumulative Update (CU), files are added, removed, and replaced. But what does not get removed or replaced is the Exchange Owa\prem folder.

Find large files with TreeSize

Find large folders and files with TreeSize Free. There are plenty of other systems that can do the same. We recommend you to download and run Treesize Free on the system. In our example, it’s the Exchange Server.

The prem folder size is 12.1 GB.

Remove old Exchange OWA files to free up disk space TreeSize

Find the Owa\prem folder

Start File Explorer and navigate to the prem folder that contains the files.

C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Owa\prem

If you don’t know the Exchange installation path, use the variable %ExchangeInstallPath%.

%ExchangeInstallPath%ClientAccess\Owa\prem

The folder will look as follow. These are the Exchange Server build numbers that are installed on the system.

Remove old Exchange OWA files to free up disk space owa prem folders

Read more: Exchange Server health check with PowerShell script »

Which of these folders can you remove?

To know which Exchange build number folders we can remove, we have to find which Exchange versions are running in the organization.

$ExchangeServers = Get-ExchangeServer | Sort-Object Name
ForEach ($Server in $ExchangeServers) {
    Invoke-Command -ComputerName $Server.Name -ScriptBlock { Get-Command Exsetup.exe | ForEach-Object { $_.FileversionInfo } }
}

After running the above script in Exchange Management Shell, look at the Exchange build number. Our example shows only one build number, which is 15.1 (Build 2242.4). Both Exchange Servers have the same build number.

ProductVersion   FileVersion      FileName                                   PSComputerName
--------------   -----------      --------                                   --------------
15.01.2242.004   15.01.2242.004   C:\Program Files\Microsoft\Exchange Ser... EX01-2016
15.01.2242.004   15.01.2242.004   C:\Program Files\Microsoft\Exchange Ser... EX02-2016

We recommend you to update all Exchange Servers to the same version.

Don’t remove the build numbers that you see in the output.

Get old Exchange build numbers total size

In the previous step, we did verify that only build number 15.1 (Build 2242.4) is running. The next step is to go to the Owa\prem folder and select all the other Exchange build number folders. After that, right-click and select Properties.

The size of these files is 10.0 GB.

Remove old Exchange OWA files to free up disk space owa prem size on disk

Remove old Exchange build numbers from Owa\prem folder

We will select the folders that we did identify in the previous step. Right-click and click on Delete. Don’t forget to empty the Recycle Bin. If you don’t want to send the folders to the Recycle Bin and immediately remove them, press Shift + Delete.

Remove old Exchange OWA files to free up disk space delete owa prem folders

We did reclaim 10.0 GB on the Exchange Server. If you have more than one Exchange Server, follow the same procedure.

Keep reading: Get disk free space with PowerShell »

Conclusion

In this article, you learned how to remove old Exchange OWA files to free up disk space. Attention is essential before you remove the Exchange build numbers folders. You need to identify which Exchange build number are running in the organization. After that, you can remove all the other build numbers from the Owa\prem folder.

Did you enjoy this article? If so, you may like Exchange 2016 OWA your connection is not secure. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 10 Comments

  1. Great article! Thank you.

    If your Exchange administrator account is a member of the “Protected Users” domain group then you need to connect to Exchange servers via FQDN. For that reason, the ComputerName parameter should be changed from $Server.Name to $Server.Fqdn

  2. Nice article.

    i have 10 Exchange 2016 servers and each has about 40GB in \owa\prem folders.
    Even after deleting them and leaving only the most current one, those folders get re-created by Exchange in the next few days, so i gave up cleaning those folders, unless someone know why those folders are coming back.

    thanks

  3. Can the other old version folders be removed from “owa”, the folder above “prem” ?

    thanks

    1. Yes, you can safely remove the old versions from C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Owa (notice that they don’t take a lot of space).

  4. Hi Ali,

    Great article – however what I am still unsure of is which folder to keep…
    My Exchange version is listed as Version 15.1 (Build 2176.2) using powershell – I look in the …\prem folder and see lots of other folders all 2GB in size as in your screenshot ie
    15.12176.2,
    15.1.2176.9,
    15.1.2176.12 &
    15.1.2176.14.
    From looking at the dates and security update versions I see that for instance 15.1.2176.14 is the latest security update for my version of Exchange 2016 CU19. Should I really be deleting it? and keeping 15.1.2176.2 ?

    Thank,
    Barney

    1. Hi Barney,

      You’re welcome.

      You need to keep the latest version, which in your case is 15.1.2176.14 (Exchange Server 2016 CU19 May21SU).

      The problem with the PowerShell cmdlet is that it only shows the CUs and not the SUs that you have installed. I updated the article with a script that will output the Exchange CUs or Exchange SUs (if installed).

      Please run the script in Exchange Management Shell. This will show that you have 15.01.2176.014 installed.

  5. Thanks Ali for the great post.

    Unfortunately I found a lot of folders with version numbers in \owa and \owa\prem on all on prem servers, while all servers are the same patch level. Any ideas regarding this sitiuation?

    Thanks
    Michael

    1. You’re welcome, Michael.

      You can ignore the folders with version numbers in \owa folder.

      1. Look at the Exchange Server build version that’s running in the organization.
      2. Remove all other Exchange Server build numbers from owa\prem.

      I updated the article with new information regarding that.

Leave a Reply

Your email address will not be published. Required fields are marked *