public void Execute(IActivityRequest request, IActivityResponse response) { SCCMServer = settings.SCCMSERVER; userName = settings.UserName; password = settings.Password; String pkgID = request.Inputs["Existing Package ID"].AsString(); String prgName = request.Inputs["Existing Program Name"].AsString(); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password); using (connection) { IResultObject col = CMInterop.getSCCMProgram(connection, "PackageID LIKE '" + pkgID + " AND ProgramName LIKE '" + prgName + "'"); CMInterop.deleteSCCMProgram(connection, pkgID, prgName); if (col != null) { response.WithFiltering().PublishRange(getObjects(col)); } response.Publish("Number of Programs", ObjCount); } }