SCCM 2007 OIP - Delete SCCM Computer works, but reports failed

Oct 23, 2012 at 11:26 AM

Is this a known issue? When using the "Delete SCCM Computer" object (referenced by ResourceID), the computer object is being deleted, but the activity returns status "failed" with the following error code:

The ConfigMgr Provider reported an error.

Exception: WqlQueryException
Target site: WqlResultObject.Get

Stack trace:
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Get(ReportProgress progressReport)
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Get()
   at SCCMExtension.system..ctor(IResultObject system)
   at SCCMExtension.DeleteComputer.d__0.MoveNext()
   at Microsoft.SystemCenter.Orchestrator.Integration.Framework.Core.FilterSet.Filter(IEnumerable values)
   at Microsoft.SystemCenter.Orchestrator.Integration.Framework.Core.FilteredResponse.PublishRange(IEnumerable values)
   at SCCMExtension.DeleteComputer.Execute(IActivityRequest request, IActivityResponse response)

We use SCCM 2007, config manager oip v1,7

Coordinator
Oct 23, 2012 at 3:53 PM

Hey Carsten,

Thanks for the bug report, I will take a look at the source code and let you know what I find shortly.

-Ryan

Coordinator
Oct 23, 2012 at 4:04 PM
Hey Carsten,
The issue that is being encountered is an order of operations problem. The object is getting a collection of SCCM objects then deleting them all in SCCM then trying to re-access them to publish properties about them (see code below). I will get a patch out for this
 public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName = settings.UserName;
            password = settings.Password;

            String filter = request.Inputs["Filter Query"].AsString();

            //Setup WQL Connection and WMI Management Scope
            WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password);

            IResultObject col = CMInterop.getSCCMObject(connection, "SMS_R_System", filter);

            CMInterop.removeSCCMObject(connection, filter, "SMS_R_System");

            if (col != null)
            {
                response.WithFiltering().PublishRange(getObjects(col));

            }
            response.Publish("Number of Systems", ObjCount);
        }
        private IEnumerable<system> getObjects(IResultObject objCollection)
        {
            foreach (IResultObject obj in objCollection)
            {
                ObjCount++;
                yield return new system(obj);
            }
        }
Coordinator
Oct 23, 2012 at 4:19 PM

The change for the fix can be viewed at http://scorch.codeplex.com/SourceControl/changeset/23414 the IP has been updated to incorporate this fix in version 2.4 (available in the dowloads section)

Oct 23, 2012 at 5:03 PM

Wow, that was quick :) Thanks Ryan, I'll check and report in this thread!

Oct 24, 2012 at 11:12 AM

Yet another noob question - what's the best way to update the IP? I tried to just install it through Deployment Mgr, but registration failes with message "Registration failed", no further info. Do I have to unregister and remove the old IP from all action servers, then register & deploy the updated one? Hope the runbooks' functionality won't suffer...

Coordinator
Oct 24, 2012 at 2:40 PM

Hey Carsten,

You need to uninstall (not unregister) the IP from your management server. You will then be able to register the IP and deploy out the new version

-Ryan

From: CarstenDUS [email removed]
Sent: Wednesday, October 24, 2012 5:12 AM
To: Ryan Andorfer
Subject: Re: SCCM 2007 OIP - Delete SCCM Computer works, but reports failed [scorch:400443]

From: CarstenDUS

Yet another noob question - what's the best way to update the IP? I tried to just install it through Deployment Mgr, but registration failes with message "Registration failed", no further info. Do I have to unregister and remove the old IP from all action servers, then register & deploy the updated one? Hope the runbooks' functionality won't suffer...

Oct 25, 2012 at 11:17 AM

IP update worked, everything is fine, Delete SCCM Computer works as it should! Thanks again!