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:
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.
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>
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>