Script to query perfmon (.blg) files

Welcome Forums General PowerShell Q&A Script to query perfmon (.blg) files

This topic contains 1 reply, has 2 voices, and was last updated by

4 years, 7 months ago.

  • Author
  • #17453

    Points: 0
    Rank: Member

    I have written a basic script to query the daily performance logs on an Exchange 2013 server. Download below from TechNet gallery

    It works fine for "standard" performance counters, but it does not work for counters with an * in them. Example \\Server\MSExchangeIS Store(*)\RPC Average Latency.

    The problem is that "\\Server\MSExchangeIS Store(*)\RPC Average Latency" is not actually a counter that exists on the server, it is a list set of counters. When you add that counter in perfmon, it adds one counter for each store on the server.

    I can expand the list set via Get-Counter -ListSet "MSExchange IS Store", then find the actual counter I want in the output and put that into the script, but I would like to get it working by just putting "MSExchangeIS Store(*)\RPC Average Latency" into the script and getting output for each Store on the server.

    Does that make sense?

    Anyone have any ideas on how I can get that working?

  • #17454

    Points: 0
    Rank: Member

    It looks lke Import-Counter also has a -ListSet parameter. Your script could run that command against the blg files, then compare your $Counter parameter (using wildcards to the list) before running Import-Counter again with the matching values. Something like this, though I haven't tested it:

    $counterList = @(Import-Counter -ListSet $env:exchangeinstallpath\Logging\Diagnostics\DailyPerformanceLogs\*.blg)
    $counterList = $counterList -like "\\$Server\$Counter"
    $Data = Import-Counter -Path $env:exchangeinstallpath\Logging\Diagnostics\DailyPerformanceLogs\*.blg -Counter $counterList

The topic ‘Script to query perfmon (.blg) files’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort