public void Execute(IActivityRequest request, IActivityResponse response) { SCCMServer = settings.SCCMSERVER; userName = settings.UserName; password = settings.Password; String pkgName = request.Inputs["New Package Name"].AsString(); String pkgDescription = request.Inputs["New Package Description"].AsString(); int pkgSourceFlag = (int)request.Inputs["New Package Source Flag"].AsUInt32(); String pkgSourcePath = request.Inputs["New Package Source Path"].AsString(); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password); using (connection) { IResultObject col = CMInterop.createSCCMSoftwareUpdatesPackage(connection, pkgName, pkgDescription, pkgSourceFlag, pkgSourcePath); if (col != null) { response.WithFiltering().PublishRange(getObjects(col)); } response.Publish("Number of Packages", ObjCount); } }