SCOM 2016 Step by Step– Part 18 – Operations Manager Shell PowerShell Error When Launched as Administrator

You wll probably get this error when you start SCOM powershell console as administrator.

“.\OperationsManager\Functions.ps1 : The term ‘.\OperationsManager\Functions.ps1’ is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:34
+ … t-Module OperationsManager; .\OperationsManager\Functions.ps1; .\Oper …
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (.\OperationsManager\Functions.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

.\OperationsManager\Startup.ps1 : The term ‘.\OperationsManager\Startup.ps1’ is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:69
+ … r; .\OperationsManager\Functions.ps1; .\OperationsManager\Startup.ps1
+                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (.\OperationsManager\Startup.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS C:\Windows\system32>

To resolve it once and for all run this code


$CMD = '$SCOMInstallPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup" -Name "InstallDirectory").InstallDirectory; Set-Location $SCOMInstallPath\..\PowerShell'
Add-Content -Path $profile.AllUsersAllHosts -Value $CMD -verbose -Force

If you don’t belive me reference is here

And now It is fine



Importing SCOM management packs after update rollup installation

So you installed new SCOM Update rollup. As you know procedure is to install new versions of management packs from folder “Management Packs for Update Rollups”. You can check procedure on this post. This is usually repeating task and sometimes we install management packs we don’t need. to make it easier I wrote script that will firstly check for installed MPs on local server and than look for new versions in  “Management Packs for Update Rollups” folders. If there is a new version it will install management packs. You can modify script easily and change to make it more suitable for you. It is maybe not SCOM friendly script but usually there is no much changes in management packs for update rollup besides new versions of files.

To download it visit TechNet Gallery link

Enjoy time you gain and use it wisely

SQL Server Broker for the Operations Manager database is disabled

I was moving Operations Manager database today, but after everything went smooth, I get this error  “SQL Server Broker for the Operations Manager database is disabled” How  to fix it?

First of all stop all SCOM services in this order

  1. System Center Management Configuration
  2. Microsoft Monitoring Agent
  3. System Center Data Access Service

After that Open SQL Management Studio and do this SQL queries (run one by one)


SELECT is_broker_enabled FROM sys.databases WHERE name='OperationsManager'

If everything is successful last query will give you result 1, so it means that SQL broker service is enabled.

Start Services in opposite order then stopping. Have a nice weekend

How to remove OMS from SCOM

I am sometimes so annoyed that once you connect your SCOM to OMS it is hard to get rid of it. You even delete workspace, but only thing you get is some errors in SCOM console. Ok how to get it out if you temporary doesn’t want it there?

I started with Kevin Holman post about it but I had some trouble doing it so here is full  story. Lets first copy paste some things.

First of all we need to stop download of intelligence  management packs from OMS and all others related. To do that,  create override with name “override OMS temporary disable” , and disable two rules. Go to Authoring > Rules, and set your scope only to “Operations Manager Management Group”

Disable the following two rules:


It will disable automatic download of OMS MPs.

Now lets delete some MP

Open PowerShell and do next commands

Get-SCOMManagementPack -name “*advisor*” | Remove-SCOMManagementPack

Get-SCOMManagementPack -name “*IntelligencePack*” | Remove-SCOMManagementPack

get-SCOMManagementPack -name “Microsoft.EnterpriseManagement.Mom.Modules.AggregationModuleLibrary” | Remove-SCOMManagementPack

First command will probably fail. you will delete only one management pack but rest of it will not be possible because of dependency. This two you will have problems with


They have dependency on this management pack and you can not delete them. So what to do?


If you added run as account for System Center Advisor Run As Profile Proxy, and probably you did,  remove it from there. After that we need to edit this management pack. Go to PowerShell again and do this (don’t run it read first).

$MP = Get-SCOMManagementpack -Name Microsoft.SystemCenter.SecureReferenceOverride

To explain.

  1. With $MP.References you will show all reference inside this MP including Advisor ones.image
  2. After that you will remove references using right Key names listed for Advisor MPs
  3. With MP.Verify() you check everything to ensure there are no orphaned overrides, etc.
  4. If everything is OK do $MP.AcceptChanges() to save everything

After that you can easily delete first override mp “override oms temporary disable”  and both  left over Advisor MPs.


If I missed some step please comment

Step by Step UR2 for System Center Operations Manager 2012 R2



even though installation is strait forward I will just give you short walkthrough. First of all, if you recently updated Operations Manger do not immediately install UR2. Leave things to cool down and after week or two, when you see everything is working fine do an update.  First thing first.  Download UR2 to some folder on your Operations Manager server. You will need to extract msp. files from cabs you downloaded.  Take your respective language you use for SCOM, and also right x86/x64 platform you use for specific roles.


After you get files this is the order you do update by roles:

◦Management server or servers
◦Gateway servers
◦Web console server role computers
◦Operations console role computers

Run all updates in admin mode. It is easiest way for me to open up command prompt in admin mode and run every msp package from there. After you install UR2 on management server it will ask you for restart. I didn’t’ do it. Afterwards I started console and operations console updates.


After updates you need to run sql script update_rollup_mom_db.sql on your  OperationsManagerDB database. You can find script under  %SystemDrive%\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server \SQL Script for Update Rollups\ on managament server. After that run UR_Datawarehouse.sql  sql script for OperationsManagerDW database found under the same path. After all these tasks I restarted management server.

Now lets import MPs. After restart you need to import next MPs from this folder: %SystemDrive%\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server\Management Packs for Update Rollups

  1. ◦Microsoft.SystemCenter.Advisor.mpb
  2. ◦Microsoft.SystemCenter.Advisor.Internal.mpb
  3. ◦Microsoft.SystemCenter.TFSWISynchronization.mpb, which has the following dependency:(Microsoft.SystemCenter.AlertAttachment.mpb, which should be installed from the SCOM 2012 R2 RTM media )  Install this one bacause if you upgraded SCOM from 2012 SP1 there is old version of MP there
  4. ◦Microsoft.SystemCenter.Visualization.Library.mpb
  5. ◦
  6. ◦Microsoft.SystemCenter.Visualization.Component.Library.mpb

image image

I get an error here but second time I tried it was successful.   This is known issues you will find in documentation (marked one on picture below).  Not to be confused I couldn’t found MP file no 5. I think it is documentation mistake. If anybody know different let me know.

After you do all this you need to update all agents. Usually it is done by going to Pending management in Administration and approving updates . In UR2 you could not see this because of known issue . You will need to do Repair task on all agents to update it to UR2 version like workaround. In monitoring pane whey you go to

Here is a list of known issue you can come around and its solutions:


I hope I helped you to get it right, and don’t forget to update console on your PCs. 🙂