{"id":2594,"date":"2011-09-19T18:12:19","date_gmt":"2011-09-19T16:12:19","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2594"},"modified":"2011-10-02T21:34:03","modified_gmt":"2011-10-02T19:34:03","slug":"discovery-sources-in-service-manager-2010","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2594","title":{"rendered":"Discovery Sources in Service Manager 2010"},"content":{"rendered":"<p>Each configuration\u00c2\u00a0object in the Service Manager CMDB has a discovery source, or multiple\u00c2\u00a0discovery sources. This list contains all connectors or sources that have updated the object during its lifecycle. For example if we synchronize an active directory user object to the CMDB the AD connector is the first discovery source. If we later update the object with another connector or manually, that connector will be discovery source two for the object. If we update the object manually it is register as SDKDefaultConnector discovery source. When there is no discovery source left, the object will be deleted from the CMDB. In some scenarios you need to find out which discovery objects a object have. In this example I have an account named John Connor. If I\u00c2\u00a0use a Active Directory connector to synchronize the account over to the Service Manager CMDB I get the following information in the CMDB.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2595\" title=\"20110918_SCSM_DiscoverySource_01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_01-300x40.jpg\" alt=\"\" width=\"300\" height=\"40\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_01-300x40.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_01.jpg 726w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If I add another AD connector, that also synchronize this John Connor account, I can see in the database that the account now I have discovery sources<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2596\" title=\"20110918_SCSM_DiscoverySource_02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_02-300x53.jpg\" alt=\"\" width=\"300\" height=\"53\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_02-300x53.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_02.jpg 729w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If I now delete the first AD connector, field.local, and run the query again, we see that the John Connor accounts now have only one discovery source, the &#8220;Accounts OU&#8221; Active Directory connector.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2597\" title=\"20110918_SCSM_DiscoverySource_03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_03-300x42.jpg\" alt=\"\" width=\"300\" height=\"42\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_03-300x42.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_03.jpg 716w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If I now delete the second AD connector too, and run the SQL query, I see that the object now is deleted as there is no longer any discovery source. All incidents where John Connor was affected user now have a blank affected user field. If I create a new Active Directory connector, Account OU v2, I can see that the account is back in the CMDB and the new connector is discovery source. For the incident that John had before, the affected user field is still blank. Even if we synchronize the same account into the CMDB, it is not mapped together with the incident again<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2598\" title=\"20110918_SCSM_DiscoverySource_04\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_04-300x33.jpg\" alt=\"\" width=\"300\" height=\"33\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_04-300x33.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_04.jpg 708w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If I update the user object manually, for example adding the Office attribute, I can see an update in the database from the SDKDefaultConnector<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_05.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2599\" title=\"20110918_SCSM_DiscoverySource_05\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_05-300x52.jpg\" alt=\"\" width=\"300\" height=\"52\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_05-300x52.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_05.jpg 530w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If I now delete the Active Directory connector, the user object will not be deleted, as the manually modification of the object is a discovery source, and Service Manager will not delete an object with discovery sources.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_06.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2600\" title=\"20110918_SCSM_DiscoverySource_06\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_06-300x44.jpg\" alt=\"\" width=\"300\" height=\"44\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_06-300x44.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110918_SCSM_DiscoverySource_06.jpg 518w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If I modify a user in the Service Manager console, and then delete the modification again, for example let\u00e2\u20ac\u2122s say I add department, then I remove it again in the service manager console, the user will still have the<br \/>\nSDKDefaultConnector as discovery source. \u00c2\u00a0The result would be that even if I delete the Active Directory connector, the user will not be deleted as there is a discovery source left for the object. Therefor it could be a good idea to update the object in the data source, in this example in Active Directory.<\/p>\n<p>This is the query I use to get discovery source of a object. Replace John Connor with any displayname<\/p>\n<blockquote><p>SELECT\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 DS.ConnectorId, BaseManagedEntity.DisplayName AS [Connector DisplayName], BaseManagedEntity_1.DisplayName AS [Object DisplayName]<br \/>\nFROM\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 DiscoverySource AS DS INNER JOIN<br \/>\nDiscoverySourceToTypedManagedEntity AS DSME ON DSME.DiscoverySourceId = DS.DiscoverySourceId INNER JOIN<br \/>\nConnector ON DS.DiscoverySourceId = Connector.ConnectorId INNER JOIN<br \/>\nBaseManagedEntity ON Connector.BaseManagedEntityId = BaseManagedEntity.BaseManagedEntityId INNER JOIN<br \/>\nBaseManagedEntity AS BaseManagedEntity_1 ON DSME.TypedManagedEntityId = BaseManagedEntity_1.BaseManagedEntityId<br \/>\nWHERE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 (BaseManagedEntity_1.DisplayName = N&#8217;John Connor&#8217;)<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Each configuration\u00c2\u00a0object in the Service Manager CMDB has a discovery source, or multiple\u00c2\u00a0discovery sources. This list contains all connectors or sources that have updated the object during its lifecycle. For example if we synchronize an active directory user object to the CMDB the AD connector is the first discovery source. If we later update the &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2594\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-2594","post","type-post","status-publish","format-standard","hentry","category-system-center-service-desk"],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2594"}],"version-history":[{"count":7,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2594\/revisions"}],"predecessor-version":[{"id":2648,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2594\/revisions\/2648"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2594"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}