Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

Automatically start and stop the enable circular logging option

We are currently archiving mailboxes to the EMC SourceOne archive. Because of this activity the Exchange log files are growing fast. Therefore I want to know if there is a method to enable the circular logging when we start with the archiving activity and disable it when the archiving activity is finished.
0
hgeurts
Asked:
hgeurts
1 Solution
 
kuriantiCommented:
Hi,

You can enable (and disable) circular logging with the set-storagegroup cmdlet. Database needs to be dismounted before. So basically:

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $True
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

save it as .ps1 file and run before archiving activity. To schedule, use syntax:
PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1" -Command ". '<Path to Your Script>'"

After the archiving, You can disable the logging:

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $False
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

Scripting with Exchange Management Shell:
http://technet.microsoft.com/en-us/library/bb123798%28EXCHG.80%29.aspx
How to Enable or Disable Circular Logging for a Storage Group:
http://technet.microsoft.com/en-us/library/bb331968%28EXCHG.80%29.aspx

Good luck,

Andreas
0
 
hgeurtsAuthor Commented:
Thanks for the info.
But for us f there is no need to dismount the databases, I do not want the disks where the logfiles are stored to grow to large and therefore causing the storage groups from becoming dismounted.
Instead of enabling them manually, I just want to schedule this automatically. Isn't this possible via the scheduled tasks in windows. or via powershell?


0
 
MinoDCCommented:
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kuriantiCommented:
You have to dismount and mount back the database every time the circular logging option is changed.
And You can use scheduled tasks to do it automatically. Example:

save the following three cmdlets as "c:\folder\enable_circular_logging.ps1" and schedule it in Windows before the archiving by executing PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1" -Command ". 'c:\folder\enable_circular_logging.ps1'"

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $True
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

This will enable circular logging on the database in SG. After the archiving, You can disable circular logging by scheduling the following, saved as c:\folder\disable_circular_logging.ps1:

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $False
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

How to use Schtasks.exe to Schedule Tasks in Windows Server 2003:
http://support.microsoft.com/kb/814596

Best,
Andreas
0
 
firemanf29Commented:
With most realtime archiving systems you move to circular logging and stay that way.  Moving back and forth daily would make your log files "unstable".
0
 
hgeurtsAuthor Commented:
We only want to start the archiving activities on Saturday, so it is only neccessary to enable circular logging during the period the archive activities are running.
Do I really need to dismount the database then before I start the circular logging?
0
 
kuriantiCommented:
Yes, You need to dismount/mount database or restart Information Store for the circular logging to take effect. "To make your changes to the circular logging settings effective, restart the Microsoft Exchange Information Store service, or dismount and then mount all of the databases in the storage group." in the mentioned TechNet article "How to Enable or Disable Circular Logging for a Storage Group" available in http://technet.microsoft.com/en-us/library/bb331968%28EXCHG.80%29.aspx

Best,
Andreas
0
 
Glen KnightCommented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now