Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (38 sloc) 1.49 KB
import-module operationsmanager -global -force
function Load-cSCOMSDK {
Loads the SCOM libraries from the GAC. A SCOM console must be installed for this to work!
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager.Common") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager") | Out-Null
function Remove-cSCOMObject {
Removes a monitoring object from the management group
This function uses the official Operations Manager 2012 SDK to remove monitoring objects (which can be piped to it). This is a very powerful tool which can
cause a lot of problems if used incorrectly! You must see this as a (supported) last resort, and try the Remove-SCOMDisabledClassInstance first.
# The monitoringobject to remove
[Microsoft.EnterpriseManagement.Monitoring.MonitoringObject] $Object,
# When using this switch, there won't be a prompt before deletion
[switch] $Force
foreach($o in $Object){
$idd = new-object Microsoft.EnterpriseManagement.ConnectorFramework.IncrementalDiscoveryData
if($Force -eq $false){
if($(Read-Host "This will remove the object $($o.FullName) from Management Group $($o.ManagementGroup.Name). Continue? [Y/N]").ToLower() -ne 'y'){