Solved

Automatically start and stop the enable circular logging option

Posted on 2010-09-03
9
891 Views
Last Modified: 2012-05-10
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
Comment
Question by:hgeurts
9 Comments
 
LVL 1

Accepted Solution

by:
kurianti earned 500 total points
ID: 33594661
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
 

Author Comment

by:hgeurts
ID: 33594694
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
 
LVL 9

Expert Comment

by:MinoDC
ID: 33594794
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 1

Expert Comment

by:kurianti
ID: 33594899
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
 
LVL 7

Expert Comment

by:firemanf29
ID: 33604960
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
 

Author Comment

by:hgeurts
ID: 33609403
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
 
LVL 1

Expert Comment

by:kurianti
ID: 33610496
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
 
LVL 74

Expert Comment

by:Glen Knight
ID: 34740736
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question