none
Powershell scripting problem RRS feed

  • 问题

  • Hi there,

    I'm now composing a script to monitor performance monitor on each exchange server. But now i have a problem with the get-counter command. 

    When I run 

     

    Get-Counter -counter "MSExchange Database\I/O Database Writes (Recovery) Average Latency" -ComputerName aaaaa

    got error message

    Get-Counter : The specified counter path could not be interpreted.

    At line:1 char:12

    + Get-Counter <<<<  -counter "MSExchange Database\I/O Database Writes (Recovery) Average Latency" -ComputerName zshamai

    l111

        + CategoryInfo          : InvalidResult: (:) [Get-Counter], Exception

        + FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.GetCounterCommand

     

     

    MSExchange Database\I/O Database Writes (Recovery) Average Latency is a mailbox server counter, not only this one, but for all the counter on Mailbox server. I could understand, because I copied these counter from this article: http://technet.microsoft.com/en-us/library/ff367871.aspx . It should be no problem.

    I have an other script to use CAS server counter it's working very well. Why I can not use Mailbox counter ???

     

    Thanks,

    Roger

    2012年2月2日 7:26

答案

  • hi,

    It seems that the Parameters -counter's path is worong.Can you make sure it is right.

    You can use get-counter -ListSet * to get all of the counter sets on the local computer.

    More information you can see:http://technet.microsoft.com/en-us/library/dd367892.aspx

    thanks,

    castin

    2012年2月3日 9:40
    版主