• Home
  • Topics
    • Office 365
    • Teams
    • SharePoint Online
    • Exchange 2019
    • Exchange 2016
    • Exchange 2013
    • Hybrid
    • Certificates
    • PowerShell
    • Migration
    • Security
    • Azure
  • Blog
  • Podcast
  • Webinars
  • Books
  • About
  • Videos
    • Interview Videos
    • How To Guide Videos
  • Subscribe
    • Facebook
    • Twitter
    • RSS
    • YouTube

Practical 365

You are here: Home / Exchange Server / How to Find Exchange Server 2010 Databases with Circular Logging Enabled

How to Find Exchange Server 2010 Databases with Circular Logging Enabled

October 29, 2010 by Paul Cunningham 11 Comments

An Exchange Server 2010 administrator may want to find out if any of the mailbox databases in the organization have been configured for circular logging.  However the Exchange Management Console does not make this information visually available.

The Exchange Management Shell can be used to determine which mailbox databases are enabled for circular logging by running the following command.

1
2
3
4
5
6
[PS] C:>Get-MailboxDatabase | where {$_.CircularLoggingEnabled -eq $true}
 
Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database 02            EX1             False           Remote
Mailbox Database 04            EX2             False           None

Another technique is to list all mailbox database sorted by their circular logging settings.

1
2
3
4
5
6
7
8
[PS] C:>Get-MailboxDatabase | select name, circularloggingenabled | sort circularloggingenabled -desc | ft -AutoSize
 
Name                CircularLoggingEnabled
----                ----------------------
Mailbox Database 04                   True
Mailbox Database 02                   True
Mailbox Database 01                  False
Mailbox Database 03                  False

Here is a method that can be used to disabled circular logging on each of the mailbox databases. Because the change doesn’t take effect until the mailbox database is dismounted and mounted again, this method also performs that task.

Caution: this may cause a disruption to mailbox access for your end users, so I do not recommend running this outside of maintenance windows.

Firstly, read the mailbox databases that have circular logging enabled into an array.

1
[PS] C:>$dbs = Get-MailboxDatabase | where {$_.CircularLoggingEnabled -eq $true}

You can see now that the two mailbox databases are in the array.

1
2
3
4
5
6
[PS] C:>$dbs
 
Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database 02            EX1             False           Remote
Mailbox Database 04            EX2             False           None

Now use the following commands to modify the circular logging setting on each mailbox database, dismount it, and mount it again.

Caution: I repeat my earlier warning that this may disrupt mailbox access for your end users. Proceed with care.

1
2
3
4
5
6
[PS] C:>foreach ($db in $dbs)
>> {Set-MailboxDatabase -Identity $db -CircularLoggingEnabled $false
>> Dismount-Database -Identity $db -Confirm:$false
>> Mount-Database -Identity $db
>> }
>>

Note: press Enter after each line and once more at the end to start processing the for loop.

Exchange Server Circular Logging, EMS, Exchange 2010, Exchange Management Shell, Mailbox Databases

Comments

  1. Abdelchafik Zahzah says

    April 21, 2020 at 9:12 pm

    Hello,
    Thanks for the Great work, however, I’m trying to modify the script to be used in a DAG environment and add a sleep of 120 sec between each database as following:

    -Remove Dismount+Mount operations (not needed in DAG DBs)
    -Add Sleep 120 sec between each DB (as i don’t want the logs of 50 DB to be purged at the same time)

    $dbs = Get-MailboxDatabase | where {$_.CircularLoggingEnabled -eq $False}
    foreach ($db in $dbs)
    {Set-MailboxDatabase -Identity $db -CircularLoggingEnabled $True
    sleep 240
    }

    Will be tankful if anyone could help.

    Reply
    • Abdelchafik Zahzah says

      April 21, 2020 at 9:25 pm

      Actually the above script is working now, but i’ll need to add the below to re-disable teh circular logging at the end of the loop circle.

      Working Script to enable the Circular logging on a delay interval of 120 sec for each DB:

      $dbs = Get-MailboxDatabase | where {$_.CircularLoggingEnabled -eq $False}
      foreach ($db in $dbs)
      {Set-MailboxDatabase -Identity $db -CircularLoggingEnabled $True
      sleep 120
      }

      Need to add the below to the above script
      Set-MailboxDatabase -Identity $db -CircularLoggingEnabled $False

      **PS: Big fan of your work and Practical365.com

      Reply
  2. praveen says

    March 14, 2020 at 4:18 am

    Hello, I enabled circular logging in exchange 2010, unfortunately, backup was running at the same time after finishing backup I checked backup status, the last backup was done. all databases are mounted state. but I have doubt it’s effect server databases or any other issues will come kindly help me on this issue.

    Reply
  3. praveen says

    March 14, 2020 at 4:17 am

    Hello, I enabled circular logging in exchange 2010, unfortunately, backup was running at the same time after finishing backup I checked backup status, the last backup was done. all databases are mounted state . but I have doubt it’s effect server databases or any other issues will come ?

    Reply
  4. Georgia Jaeger says

    April 10, 2018 at 1:13 am

    Does turning circular logging on an existing database disrupt service or cause loss of email? I am working with an environment that has circular logging on some of the databases but not all. Backups are failing as the database without circular logging (being large) is still being backed to NAS when the copy to external drive starts. I would need to clean up the transaction logs in the database to reduce the size. Would just turning on circular logging do the trick or will I need to do the dismount, wipe and remount? I’m a chicken to dismount the database.

    Reply
    • Georgia Jaeger says

      April 10, 2018 at 1:28 am

      addendum: when I say that backups are failing, I’m speaking to the server level bare metal backup to NAS, not the Exchange internal backup.

      GJ

      Reply
    • Paul Cunningham says

      April 10, 2018 at 10:44 am

      If you’re running a backup correctly, the transaction logs for the database that doesn’t have circular logging enabled should be getting truncated (removed) automatically. If that is not happening, I suspect your backup is misconfigured or is not the correct type of backup, which calls into question whether you will even be able to use that backup to restore data if there is a problem. I recommend you look at your backups configuration.

      Reply
  5. John says

    December 9, 2017 at 12:28 am

    Thank you Paul, I am installing a backup for our Exchange DAG. The Exchange administrator has disabled the circular logging.
    Should i still do the full backup or copy backup ? My understanding is that the DAG truncates the logs after shipping .

    Reply
    • Paul Cunningham says

      December 9, 2017 at 7:22 am

      Please refer to your backup product’s documentation, and the Exchange backup documentation on TechNet, about what each backup does. It’s important to read and understand these things before you settle on a backup strategy.

      Reply
  6. Allan says

    July 27, 2016 at 11:19 pm

    Thank you Paul. This was very helpful and still relevant to Exchange 2016.

    I had to turn on Circular Logging as it was off by default and I found my self out of disk space unexpectedly.

    Just had to adapt the scripts above.

    Reply
    • Paul Cunningham says

      July 28, 2016 at 9:10 am

      Hopefully you’re backing up your databases? Otherwise yes, they’ll fill up the log drives eventually. Circular logging isn’t really the solution to that problem.

      Reply

Leave a Reply Cancel reply

You have to agree to the comment policy.

Recent Articles

  • Microsoft Launches Group Ownership Governance Policy
  • Making the Case for Identity Governance in Azure Active Directory
  • Prepare an Office 365 migration plan assessment using PowerShell
  • Microsoft Releases May 2022 Exchange Server Security Updates
  • New Future of Work for Microsoft 365, IOT and more: Practical 365 Podcast S3 Ep. 2

Copyright © 2022 Quadrotech Solutions AG · Disclosure · Privacy Policy
Alpenstrasse 15, 6304 Zug, Switzerland