Пример #1
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String objID         = request.Inputs["Collection ID"].AsString();
            String contentIDList = request.Inputs["Content ID List (CSV)"].AsString();
            bool   refreshDPs    = request.Inputs["Refresh DPs"].AsBoolean();

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

            using (connection)
            {
                CM2012Interop.modifySCCMSoftwareUpdatesPackageRemoveCIs(connection, objID, contentIDList, refreshDPs);

                IResultObject col = null;
                col = CM2012Interop.getSCCMSoftwareUpdatesPackage(connection, "PackageID LIKE '" + objID + "'");

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Collections", ObjCount);
            }
        }
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String objID = request.Inputs["Package ID"].AsString();

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

            try
            {
                String[] propertyNameChoices = CM2012Interop.getSCCMObjectPropertyNames(connection, "SMS_SoftwareUpdatesPackage");
                foreach (String propertyName in propertyNameChoices)
                {
                    if ((request.Inputs.Contains(propertyName + " : Property Type")) && (request.Inputs.Contains(propertyName + " : Property Value")))
                    {
                        CM2012Interop.modifySCCMSoftwareUpdatesPackage(connection, objID, request.Inputs[(propertyName + " : Property Type")].AsString(), propertyName, request.Inputs[(propertyName + " : Property Value")].AsString());
                    }
                }

                IResultObject col = CM2012Interop.getSCCMSoftwareUpdatesPackage(connection, "PackageID LIKE '" + objID + "'");
                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Packages", ObjCount);
            }
            finally
            {
                connection.Close();
                connection.Dispose();
            }
        }
Пример #3
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String objID = request.Inputs["Package ID"].AsString();

            uint flags = 0x00000000;

            if (request.Inputs["DO_NOT_DOWNLOAD"].AsBoolean())
            {
                flags ^= DO_NOT_DOWNLOAD;
            }
            if (request.Inputs["PERSIST_IN_CACHE"].AsBoolean())
            {
                flags ^= PERSIST_IN_CACHE;
            }
            if (request.Inputs["USE_BINARY_DELTA_REP"].AsBoolean())
            {
                flags ^= USE_BINARY_DELTA_REP;
            }
            if (request.Inputs["NO_PACKAGE"].AsBoolean())
            {
                flags ^= NO_PACKAGE;
            }
            if (request.Inputs["USE_SPECIAL_MIF"].AsBoolean())
            {
                flags ^= USE_SPECIAL_MIF;
            }
            if (request.Inputs["DISTRIBUTE_ON_DEMAND"].AsBoolean())
            {
                flags ^= DISTRIBUTE_ON_DEMAND;
            }

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

            using (connection)
            {
                String flagsString = Convert.ToString((int)flags);

                CM2012Interop.modifySCCMSoftwareUpdatesPackage(connection, objID, "IntegerValue", "PkgFlags", flagsString);
                IResultObject col = CM2012Interop.getSCCMSoftwareUpdatesPackage(connection, "PackageID LIKE '" + objID + "'");
                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Packages", ObjCount);
            }
        }
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

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

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

            using (connection)
            {
                IResultObject col = null;
                col = CM2012Interop.getSCCMSoftwareUpdatesPackage(connection, filter);

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Packages", ObjCount);
            }
        }