Skip to content

Remove old Exchange OWA files to free up disk space

You want to free up disk space on the Exchange Server. After scanning the Exchange Server to know what is taking space, you find more than a couple of GBs 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 Server Cumulative Update (CU) and Exchange Server Security Update (SU), 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 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 below. 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

Note: We recommend you update all Exchange Servers to the same version by installing the Exchange Server Cumulative Update and Exchange Server Security Update.

Important: Don’t remove the build numbers 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.

Note: If you want to free up more space on the Exchange Server, an excellent way is to remove old Exchange Server logs.

Keep reading: Get disk free space with PowerShell »

Conclusion

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 is 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 Server 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 15 Comments

  1. Hi Ali,

    Thanks for this write up. Good information in there and very helpful. One question I have is about the versions. The following folders are listed in ClientAccess\Owa.

    15.2.1258.25 (modified (9/16/23)
    15.2.1258.16 (modified 6/17/2023)
    15.2.1258.12 (modified 5/6/2023)

    Running “Get-ExchangeServer” shows it’s using “Version 15.2 (Build 1258.12)”. That is the oldest of the three versions. Why is that being used? Is there any reason and/or way to change that?

    Thanks!

    1. Don’t run the Get-ExchangeServer cmdlet. Instead, run the script from the article.

      The problem with the Get-ExchangeServer cmdlet is that it only shows the CUs and not the SUs that you have installed.

      Once you run the script, you will see that you have this Exchange Server version running: 15.2.1258.25

  2. 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

  3. 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

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

    thanks

  5. 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.

  6. 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 *