SCOM Bi-Directional Integration Failure After Australia Upgrade — TypeNotFound / Configuration System ErrorIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } After upgrading to the Australia release, SCOM connector bi-directional functionality may fail with TypeNotFound or Configuration system failed to initialize errors. Event collection (inbound) continues to work normally — only the bi-directional (outbound) path is affected. This article covers diagnosis and resolution of two related issues: Incorrect scom_version parameter causing wrong SCOM DLLs to be loadedMalformed powershell.exe.config causing .NET configuration initialization failure Symptoms<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Error 1 — TypeNotFound The connector instance shows: Last bi-directional status: ErrorLast error message: BI-DIRECTIONAL ------------------------------------------------------------- new-object : Cannot find type [Microsoft.EnterpriseManagement.ManagementGroupConnectionSettings]: verify that the assembly containing this type is loaded. At <MID_HOME>\agent\scripts\Powershell\Invoke-UpdateAlert.ps1:39 char:17 Unable to find type [Microsoft.EnterpriseManagement.ManagementGroup]. At <MID_HOME>\agent\scripts\Powershell\Invoke-UpdateAlert.ps1:45 char:11 Error 2 — Configuration System Failed to Initialize After fixing Error 1, the connector may show: BI-DIRECTIONAL ------------------------------------------------------------- Exception calling "Connect" with "1" argument(s): "Configuration system failed to initialize" + FullyQualifiedErrorId : ConfigurationErrorsException With inner exception: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 2, position 3. (C:\Windows\system32\windowspowershell\v1.0\powershell.exe.Config line 2) Facts<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Australia Release Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Wrong DLL Loading Path The PowerShell script Invoke-UpdateAlert.ps1 uses the scom_version connector parameter to decide which SCOM SDK DLLs to load: scom_version valueDLLs loaded"2012"Core.dll, OperationsManager.dll, Runtime.dll (modern — correct for SCOM 2012/2016/2019/2022/2025)Any other valueOperationsManager.Common.dll, OperationsManager.dll (legacy — SCOM 2007 only) The ScomJS MID script include contains normalization logic to convert modern versions to "2012": var version = this.getParamValue("scom_version", "2007"); var allowedVersions = ["2016", "2019", "2022", "2025"]; if (allowedVersions.includes(version)) version = "2012"; However, on some instances, this normalization is either not present or not functioning. When scom_version is set to "2019" or "2016", the script falls into the legacy branch and tries to load OperationsManager.Common.dll, which does not exist for modern SCOM versions — resulting in the TypeNotFound error. Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Diagnostic Steps : Step 1 — Verify DLLs Exist and Load on the MID Server Run this PowerShell script as Administrator on the MID Server host. Note: Adjust $midHome to match the customer's MID Server installation path. # Adjust this path to the customer's MID installation $midHome = "<MID_INSTALL_PATH>\agent" $extlib = "$midHome\extlib" Write-Host "==== Step 1: DLLs in extlib ====" -ForegroundColor Cyan $dlls = @("Microsoft.EnterpriseManagement.Core.dll", "Microsoft.EnterpriseManagement.OperationsManager.dll", "Microsoft.EnterpriseManagement.Runtime.dll") foreach ($dll in $dlls) { $p = Join-Path $extlib $dll if (Test-Path $p) { $f = Get-Item $p Write-Host " FOUND: $dll ($($f.Length) bytes)" -ForegroundColor Green } else { Write-Host " MISSING: $dll" -ForegroundColor Red } } Write-Host "`n==== Step 2: Legacy DLL check ====" -ForegroundColor Cyan Write-Host "OperationsManager.Common.dll exists: $(Test-Path "$extlib\Microsoft.EnterpriseManagement.OperationsManager.Common.dll")" Write-Host "`n==== Step 3: Unblock & Load ====" -ForegroundColor Cyan Get-ChildItem "$extlib\Microsoft.EnterpriseManagement.*.dll" -ErrorAction SilentlyContinue | Unblock-File foreach ($dll in $dlls) { $p = Join-Path $extlib $dll try { Add-Type -Path $p -ErrorAction Stop Write-Host " LOADED: $dll" -ForegroundColor Green } catch { Write-Host " FAILED: $dll" -ForegroundColor Red Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red if ($_.Exception.InnerException) { Write-Host " Inner: $($_.Exception.InnerException.Message)" -ForegroundColor Red } } } Write-Host "`n==== Step 4: Type availability test ====" -ForegroundColor Cyan try { $s = New-Object Microsoft.EnterpriseManagement.ManagementGroupConnectionSettings("localhost") Write-Host " ManagementGroupConnectionSettings: AVAILABLE" -ForegroundColor Green } catch { Write-Host " ManagementGroupConnectionSettings: NOT AVAILABLE - $($_.Exception.Message)" -ForegroundColor Red } Write-Host "`n==== Step 5: PowerShell environment ====" -ForegroundColor Cyan Write-Host "PS Version: $($PSVersionTable.PSVersion) | Arch: $([IntPtr]::Size * 8)-bit | CLR: $($PSVersionTable.CLRVersion)" Expected result: All 3 DLLs FOUND, LOADED, and type AVAILABLE. Step 2 — Check What Version the MID Server Is Actually Passing Run this PowerShell on the MID Server host: $midHome = "<MID_INSTALL_PATH>\agent" Get-ChildItem "$midHome\logs\agent0.log*" | Sort-Object LastWriteTime -Desc | Select-Object -First 1 | ForEach-Object { $cmds = Select-String -Path $_.FullName -Pattern "COMMAND:" | Select-Object -Last 3 if ($cmds) { foreach ($cmd in $cmds) { Write-Host $cmd.Line if ($cmd.Line -match "agent\s+(\S+)\s+'") { Write-Host " >>> VERSION PASSED: $($Matches[1])" -ForegroundColor Yellow if ($Matches[1] -eq "2012") { Write-Host " >>> CORRECT!" -ForegroundColor Green } else { Write-Host " >>> WRONG! Should be 2012, got $($Matches[1])" -ForegroundColor Red } } } } else { Write-Host "No COMMAND entries found - bi-directional may not have been triggered yet" -ForegroundColor Red } } Expected result: VERSION PASSED: 2012. If it shows 2019, 2016, or any other value, proceed to the fix. Step 3 — Check scom_version on the Connector Instance Step 4 — Check PowerShell Config Files (if Error 2 occurs) Run as a MID Server background script on the affected MID: var paths = [ "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe.config", "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe.config" ]; for (var i = 0; i < paths.length; i++) { var file = new Packages.java.io.File(paths[i]); if (file.exists()) { var fis = new Packages.java.io.FileInputStream(file); var bytes = new Array(3); bytes[0] = fis.read(); bytes[1] = fis.read(); bytes[2] = fis.read(); fis.close(); ms.log(paths[i] + " exists, first 3 bytes: " + bytes[0] + " " + bytes[1] + " " + bytes[2]); if (bytes[0] == 239 && bytes[1] == 187 && bytes[2] == 191) { ms.log(" >>> HAS UTF-8 BOM - THIS IS THE PROBLEM!"); } else if (bytes[0] == 60) { ms.log(" >>> No BOM - file looks correct"); } } else { ms.log(paths[i] + " MISSING"); } } Fix 1 — Change scom_version to "2012" Option A — Via UI: Navigate to the SCOM connector instanceIn Connector Instance Values, find scom_versionChange the value to 2012Click Update Option B — Via Background Script: // Replace <CONNECTOR_SYS_ID> with the actual sys_id var gr = new GlideRecord('em_connector_instance_value'); gr.addQuery('connector_instance', '<CONNECTOR_SYS_ID>'); gr.addQuery('name', 'scom_version'); gr.query(); if (gr.next()) { gs.print('BEFORE: scom_version = ' + gr.getValue('value')); gr.setValue('value', '2012'); gr.update(); gs.print('AFTER: scom_version = 2012'); } Important: Repeat for ALL SCOM connector instances. Each connector may use a different MID Server. Fix 2 — Recreate powershell.exe.config Without BOM (if Error 2 occurs) Run as a MID Server background script on the affected MID: var configContent = '<?xml version="1.0" encoding="utf-8"?>\r\n<configuration>\r\n <startup useLegacyV2RuntimeActivationPolicy="true">\r\n <supportedRuntime version="v4.0"/>\r\n <supportedRuntime version="v2.0.50727"/>\r\n </startup>\r\n</configuration>'; var paths = [ "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe.config", "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe.config" ]; for (var i = 0; i < paths.length; i++) { var file = new Packages.java.io.File(paths[i]); var fos = new Packages.java.io.FileOutputStream(file); var bytes = new Packages.java.lang.String(configContent).getBytes("UTF-8"); fos.write(bytes); fos.close(); ms.log("Written: " + paths[i] + " (" + bytes.length + " bytes)"); } Why not use PowerShell's Set-Content? PowerShell's -Encoding UTF8 adds a BOM, which breaks .NET's XML parser. The Java I/O approach writes UTF-8 without BOM. Alternative (if MID background script is unavailable): Run on the MID host PowerShell as Administrator: $q = [char]34 $content = "<?xml version=${q}1.0${q} encoding=${q}utf-8${q}?>`r`n<configuration>`r`n <startup useLegacyV2RuntimeActivationPolicy=${q}true${q}>`r`n <supportedRuntime version=${q}v4.0${q}/>`r`n <supportedRuntime version=${q}v2.0.50727${q}/>`r`n </startup>`r`n</configuration>" $utf8NoBom = New-Object System.Text.UTF8Encoding($false) [System.IO.File]::WriteAllText("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.config", $content, $utf8NoBom) [System.IO.File]::WriteAllText("C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe.config", $content, $utf8NoBom) Get-Content "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.config" Step 3 — Restart the MID Server Restart only the MID Server(s) assigned to the affected SCOM connector instance(s). The MID caches script includes and needs a restart to pick up the parameter change. Step 4 — Trigger Bi-Directional Bi-directional only fires when an alert action occurs in ServiceNow (close, reopen, or ticket_id update). To test: Find an open alert with Source = SCOMClick Close on the alertWait 30 seconds Step 5 — Verify Option A — Via UI: Refresh the connector instance page. Check: - Last bi-directional status: Success - Last error message: (empty) Option B — Via Background Script: var ci = new GlideRecord('em_connector_instance'); ci.get('<CONNECTOR_SYS_ID>'); gs.print('Bi-directional status: ' + ci.getValue('last_bidirectional_status')); gs.print('Last error: ' + (ci.getValue('last_error_message') || 'none')); Option C — Via MID Server Logs: $midHome = "<MID_INSTALL_PATH>\agent" Get-ChildItem "$midHome\logs\agent0.log*" | Sort-Object LastWriteTime -Desc | Select-Object -First 1 | ForEach-Object { Select-String -Path $_.FullName -Pattern "COMMAND:" | Select-Object -Last 1 | ForEach-Object { Write-Host $_.Line } } Confirm the COMMAND shows 2012 as the version parameter.