Answered by:
Removing old SCVMM connectors

Question
-
After removing the SCVMM management pack I'm stuck with about 30 connectors which have been created.
I've found a KB article (http://support.microsoft.com/kb/2626670) providing a powershell script which would allow for the connectors to be removed. For some reason however, the script won't work for me.
If I run the script as stated i.e. DeleteConnector.ps1 'SCVMMConnector XXXX'
Nothing happens and the connector doesn't disappear from the SCOM interface.
I've tried running this from the RMS and from my workstation.
Monday, October 17, 2011 1:59 PM
Answers
-
update code a bit, you are casting Object to String, and as result "if($connector.Name -eq ${name})" does not work.
$ConnectorNames = Get-Connector | Where {$_.Name -match "SCVMM"} Foreach ($ConnectorName in $ConnectorNames) { #New-Connector $connectorName write-host "Delete-Subscription" Delete-Subscription $connectorName.Name #add .Name to prevent automatic casting to string write-host "Remove-Connector" Remove-Connector $connectorName.Name #add .Name here }
- Proposed as answer by Nicholas Li Wednesday, October 19, 2011 4:14 AM
- Marked as answer by Bas van der Kruijssen Wednesday, October 19, 2011 6:42 AM
Tuesday, October 18, 2011 2:49 PM
All replies
-
Hi,
Start a powershell.exe on RMS and run this script. Do you see any errors?
http://OpsMgr.ru/Monday, October 17, 2011 3:47 PM -
Well, it seems it helps when I put quotes around names with spaces in it...
Still have a question though. Like I said, there's about 20 or more connectors and I can't seem to get this script to run twice in a row manually without actually restarting powershell.
I've tried to loop through all the connectors with the below addition to the script and it seems to do something, but the connectors remain...
$ConnectorNames = Get-Connector | Where {$_.Name -match "SCVMM"}
Foreach ($ConnectorName in $ConnectorNames)
{
#New-Connector $connectorName
write-host "Delete-Subscription"
Delete-Subscription $connectorName
write-host "Remove-Connector"
Remove-Connector $connectorName
}This results in the below result in Powershell:
Tuesday, October 18, 2011 7:31 AM -
these connectors usually get deleted when you disabled integration on VMM side.
have you done this?
Tuesday, October 18, 2011 11:18 AM -
Unfortunately this wasn't possible as the VMM server suffered a major hardware failure and backups weren't consistent. So we had to rebuild the complete VMM environment.
I'm now cleaning up the clutter, which means removing all VMM references in SCOM before re-importing the VMM management pack.
- Proposed as answer by Pavel Dzemyantsau Tuesday, October 18, 2011 2:32 PM
- Unproposed as answer by Pavel Dzemyantsau Tuesday, October 18, 2011 2:32 PM
Tuesday, October 18, 2011 11:29 AM -
update code a bit, you are casting Object to String, and as result "if($connector.Name -eq ${name})" does not work.
$ConnectorNames = Get-Connector | Where {$_.Name -match "SCVMM"} Foreach ($ConnectorName in $ConnectorNames) { #New-Connector $connectorName write-host "Delete-Subscription" Delete-Subscription $connectorName.Name #add .Name to prevent automatic casting to string write-host "Remove-Connector" Remove-Connector $connectorName.Name #add .Name here }
- Proposed as answer by Nicholas Li Wednesday, October 19, 2011 4:14 AM
- Marked as answer by Bas van der Kruijssen Wednesday, October 19, 2011 6:42 AM
Tuesday, October 18, 2011 2:49 PM -
Hi,
Additionally, please also see if you can remove the connector manually referring to the method in the following post:
Removing an old product connector
http://blogs.technet.com/b/kevinholman/archive/2009/09/10/removing-an-old-product-connector.aspx
Hope this helps.
Nicholas Li - MSFT
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.Wednesday, October 19, 2011 4:14 AM -
Thank you Pavel!
By converting the object to string the connectors were deleted in seconds instead of deleting them all one by one.
Another lesson learned there :-)
Wednesday, October 19, 2011 6:43 AM -
Hello Bas,
If you removed the RMS settings from the SCVMM Admin Console this would remove the SCVMM connectors on the SCOM
Regards,
Mazen
Tuesday, October 25, 2011 9:39 AM -
yep, see above
>have you done this?
>these connectors usually get deleted when you disabled integration on VMM side.>>>Unfortunately this wasn't possible as the VMM server suffered a major hardware failure and backups weren't consistent. So we had to rebuild the complete VMM environment.
- Proposed as answer by Mazen AhmedMicrosoft employee Tuesday, October 25, 2011 3:19 PM
Tuesday, October 25, 2011 10:52 AM -
I found that after I removed my OpsMgr connection from the VMM console, the connectors in OpsMgr still existed. Even though in the SCVMM 2012 R2 console no connection to OpsMgr was showing, there was still an active connection configured. I ran "Get-SCOpsMgrConnection" on the VMM server and sure enough, it gave me the details of my old connection. I then ran "Remove-SCOpsMgrConnection" and everything was cleaned up from OpsMgr.Tuesday, July 8, 2014 6:07 PM
-
Thank you Pavel, had a similar situation occur where I am forced to ungracefully remove the old scvmm connectors to upgrade to 2012 and this came in handy!Tuesday, November 18, 2014 12:55 AM