"The 'finally' keyword is not supported" error in CheckMaxConcurrentAPI.ps1 in SCOM 2007 R2

Article translations Article translations
Article ID: 2856250 - View products that this article applies to.
Expand all | Collapse all

Symptoms

When the CheckMaxConcurrentAPI.ps1 Windows PowerShell script fails in Microsoft System Center Operations Manager (SCOM) 2007 R2, the MaxConCurrentAPI monitor generates an error message that resembles the following:

The PowerShell script failed with below exception
System.Management.Automation.ParseException: The 'finally' keyword is not supported in this version of the language.
At line:148 char:8
+ finally
<<<<{
at System.Management.Automation.Parser.finallyStatementRule(Tokenizer tok)
at System.Management.Automation.Parser.statementRule(Tokenizer tok)
at System.Management.Automation.Parser.statementListRule(Tokenizer tok)
at System.Management.Automation.Parser.cmdletBodyRule(Tokenizer tok, Token fnName, Boolean isFilter, ParameterDeclarationNode parameters, Boolean scriptMode)
at System.Management.Automation.Parser.functionDeclarationRule(Tokenizer tok)
at System.Management.Automation.Parser.statementRule(Tokenizer tok)
at System.Management.Automation.Parser.statementListRule(Tokenizer tok)
at System.Management.Automation.Parser.Parse(String input, Int32 cursorPosition)
at System.Management.Automation.AutomationEngine.Parse(String script, Boolean interactiveCommand)
at System.Management.Automation.ShellFunctionCommandProcessor..ctor(String script, ExecutionContext context, Boolean isFilter, Boolean useLocalScope, Boolean interactiveCommand)
at System.Management.Automation.Runspaces.Command.CreateCommandProcessor(ExecutionContext executionContext, CommandFactory commandFactory, Boolean addToHistory)
at System.Management.Automation.Runspaces.LocalPipeline.CreatePipelineProcessor()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()

Script Name: CheckMaxConcurrentAPI.ps1

One or more workflows were affected by this.

Workflow name: Microsoft.Windows.Server.2008.MaxConcurrentAPI.Monitor
Instance name: Microsoft Windows Server 2008 Standard without Hyper-V
Instance ID: <Instance ID>
Management group: <MG name>
Note This issue occurs after you import the System Center Management Pack for Windows Server Operating System version 6.0.7026.0 into a System Center Operations Manager 2007 R2 management group.

Cause

This issue occurs because System Center Operations Manager 2007 R2 and its management pack use a version of Windows PowerShell 2.0 that doesn’t support the "finally" keyword.

Resolution

To resolve this issue, install the Windows Management Framework Core package (Windows PowerShell 2.0 and WinRM 2.0).

Workaround

To work around this issue without installing the Windows PowerShell 2.0 update, use one of the following methods: 
  • Disable the Max Concurrent API monitor.

    For more information about how to do this, go to the following Microsoft website:
    How to Disable a Monitor or Rule Using Overrides
  • Migrate to Microsoft System Center 2012 Operations Manager.

Properties

Article ID: 2856250 - Last Review: September 27, 2013 - Revision: 5.0
Applies to
  • Microsoft System Center Operations Manager 2007 R2
Keywords: 
KB2856250

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com