public void Execute(IActivityRequest request, IActivityResponse response) { SCCMServer = settings.SCCMSERVER; userName = settings.UserName; password = settings.Password; int referenceID = (int)request.Inputs["Reference Computer Resource ID"].AsUInt32(); int destinationID = (int)request.Inputs["Destination Computer Resource ID"].AsUInt32(); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password); using (connection) { CMInterop.associateComputer(connection, referenceID, destinationID); IResultObject col = null; col = CMInterop.getSCCMComputer(connection, Convert.ToString(destinationID), "", ""); if (col != null) { response.WithFiltering().PublishRange(getObjects(col)); } response.Publish("Number of Systems", ObjCount); } }