locked
Transaction Log Sizes RRS feed

  • Question

  • Hello,

    Is there a way of getting the transaction log folder for each mailbox database and exporting it out to a CSV? I was thinking of using powershell but I am unsure as to how this could be done?

    We are having some issues with out backups and it looks like sometimes they don't truncate the logs so I am wondering if I could pull out a report from exchange to give me this information so I can see the sizes going up or down. 

    Thanks

    James


    Friday, July 7, 2017 10:04 AM

All replies

  • Get-MailboxDatabase -Status | % { $ActiveLogs = "`\`\$($_.MountedOnServer)`\$($_.LogFolderPath.PathName.Replace(':','$'))" ; $ActiveLogCount = (Dir $ActiveLogs).Count ; $_ } | Select MountedOnServer, LogFolderPath, @{L='ActiveLogs'; E={ $ActiveLogCount }}

    This gives you a count of the log files in the directory.  If you need more than this, let me know.

    PowerShell is your friend.  :-D


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })


    Friday, July 7, 2017 1:03 PM
  • Thank you.

    Yes I would need to know the sizes of the folders, so in essence for each mailbox database the size of the transaction logs so I can compare from day to day ensuring they are staying roughly around the same and are not continuing to climb for example.

    Is this possible?

    Thank You

    James

    Thursday, July 13, 2017 2:44 PM
  • Hi James,

    To achieve your goal, I recommend to schedule a task to monitor database growth.
    Here's a similar script for your reference:
    https://gallery.technet.microsoft.com/scriptcenter/ExchangeDatabaseGrowthRepor-2c506048

    More details, refer to:
    https://blogs.technet.microsoft.com/exchange/2014/01/06/exchange-2010-and-2013-database-growth-reporting-script/

    Hope it helps.

    Regards,

    Allen Wang


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, July 14, 2017 3:23 AM
    Moderator
  • James, you need to keep track of the logs over time, so Allen's report would be necessary - you collect the data daily so you can determine how your traffic trends over time.  You will probably find that you have spikes on specific days of the week, but your weekly volume will be relatively consistent over time.  Of course, you could also just figure out how many transaction logs you have that are over 24 hours old - if your backup solution is working properly, you should have none.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Tuesday, July 18, 2017 6:40 PM
  • Hi James,

    Any update about your issue?

    If the above suggestion is useful, please be free to mark it as answer. Thanks for your cooperation.

    Regards,

    Allen Wang


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, July 21, 2017 1:34 AM
    Moderator