How to remove old product connectors from System Center Operations Manager 2007


hotfixJust a quick heads up on a new KB article we published today:

=====

Symptoms

Removing an old product connector from System Center Operations Manager 2007 (OpsMgr 2007) may be necessary if the product connector is no longer used in the environment. There is no Delete option in admin console UI for product connectors so the script below can be used to achieve the desired results.

Resolution

Use the following Powershell script to remove the product connector:

Note Internal Connectors should not be removed, also be sure to backup both the Operational DB and the Data Warehouse before running this. Also save the below as DeleteConnector.ps1

param(
[String] $connectorName,
[String] $mgName="localhost"
)
Import-Module OperationsManager
$mg = new-object Microsoft.EnterpriseManagement.ManagementGroup $mgName
New-ManagementGroupConnection -ComputerName $mgName

##########################################################################################
# Configures a connector with the specified name.
##########################################################################################
function New-Connector([String] $name)
{
$connectorForTest = $null;
$connectorForTest = Get-Connector | where {$_.Name -eq $name}
if ($connectorForTest -eq $null)
{
$admin = $mg.ConnectorFramework
$testConnector = New-Object Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorInfo
$testConnector.Name = $name
$testConnector.Description = "${name} Description"
$testConnector.DiscoveryDataIsManaged = $false
$connectorForTest = $admin.Setup($testConnector)
$connectorForTest.Initialize();
}
return $connectorForTest
}


##########################################################################################
# Removes a connector with the specified name.
##########################################################################################
function Remove-Connector([String] $name)
{
$admin = $mg.ConnectorFramework
$testConnector = Get-Connector -Name $name

foreach($alert in $testConnector.GetMonitoringAlerts())
{
$alert.ConnectorId = $null;
$alert.Update("Delete Connector");
}

if($testConnector.Initialized)
{
$testConnector.Uninitialize()
}
$connectorIdForTest = $admin.Cleanup($testConnector)
}

##########################################################################################
# Delete a connector’s Subscription
##########################################################################################
function Delete-Subscription([String] $name)
{
$connector = Get-Connector | where {$_.Name -eq $name}
$subs = $mg.ConnectorFramework.GetConnectorSubscriptions()
$admin = $mg.ConnectorFramework
foreach($sub in $subs)
{
if($sub.MonitoringConnectorId -eq $connector.id)
{
$admin.DeleteConnectorSubscription($admin.GetConnectorSubscription($sub.Id))
}
}
}

#New-Connector $connectorName
write-host "Delete-Subscription"
Delete-Subscription $connectorName
write-host "Remove-Connector"
Remove-Connector $connectorName

More Information

Usage: DeleteConnector.ps1 para1 para2

para1: Connector Name

para2: MS name, Optional, default value: localhost

Note If you attempt to delete the Operations Manager Internal Connector from the database it will generate the following error:

Exception content:

Exception calling "Setup" with "1" argument(s): "Discovery data generated by invalid connector:7431E155-3D9E-4724-895E-C03BA951A352."

=====

For the most current version of this article please see the following:

2626670: How to remove old product connectors from System Center Operations Manager 2007

J.C. Hornbeck | System Center Knowledge Engineer

App-V Team blog: http://blogs.technet.com/appv/
AVIcode Team blog: http://blogs.technet.com/b/avicode
ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
DPM Team blog: http://blogs.technet.com/dpm/
MED-V Team blog: http://blogs.technet.com/medv/
OOB Support Team blog: http://blogs.technet.com/oob/
Opalis Team blog: http://blogs.technet.com/opalis
Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/
OpsMgr Support Team blog: http://blogs.technet.com/operationsmgr/
SCMDM Support Team blog: http://blogs.technet.com/mdm/
SCVMM Team blog: http://blogs.technet.com/scvmm
Server App-V Team blog: http://blogs.technet.com/b/serverappv
Service Manager Team blog: http://blogs.technet.com/b/servicemanager
System Center Essentials Team blog: http://blogs.technet.com/b/systemcenteressentials
WSUS Support Team blog: http://blogs.technet.com/sus/

clip_image001 clip_image002

Comments (1)

  1. show box says:

    Thanks for the great info. I really loved this. I would like to apprentice at the same time as you amend your web site, how could i subscribe for a blog site?
    For more info on showbox please refer below sites:
    http://showboxandroids.com/showbox-apk/
    http://showboxappandroid.com/
    Latest version of Showbox App download for all android smart phones and tablets.
    http://movieboxappdownloads.com/ – It’s just 2 MB file you can easily get it on your android device without much trouble. Showbox app was well designed application for android to watch movies and TV shows, Cartoons and many more such things on your smartphone.
    For showbox on iOS (iPhone/iPad), please read below articles:
    http://showboxappk.com/showbox-for-ipad-download/
    http://showboxappk.com/showbox-for-iphone/
    Showbox for PC articles:
    http://showboxandroids.com/showbox-for-pc/
    http://showboxappandroid.com/showbox-for-pc-download/
    http://showboxforpcs.com/
    There are countless for PC clients as it is essentially easy to understand, simple to introduce, gives continuous administration, effectively reasonable. it is accessible at completely free of expense i.e., there will be no establishment charges and after establishment
    it doesn’t charge cash for watching films and recordings.
    http://www.showboxforipad.org/showbox-apk/ Not simply watching, it likewise offers alternative to download recordings and motion pictures. The accompanying are the strides that are to be taken after to introduce Showbox application on Android. The above
    all else thing to be done is, go to the Security Settings on your Android telephone, Scroll down and tap on ‘Obscure sources’.
    http://www.showboxforipad.org/
    http://movieboxappdownloads.com/moviebox-apk-android/
    http://movieboxappdownloads.com/download-moviebox-pc/
    Movie Box, an esteemed movies application in which you can find stacks of programs and films. The guide is given here to download Movie Box app to Android and to Apple iOS 9.0.2, iOS 8.4/8.3 and also for the lower versions without Jailbreak.
    http://showboxforiphone.org/
    Please do login to Showbox application with the help of Ymail. You can login in Ymail from here –
    http://ymaillogintips.com/
    Sign Up & Do registration for latest movies on Showbox application