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 = CMInterop.connectSCCMServer(SCCMServer, userName, password);

            using (connection)
            {
                String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_BootImagePackage");
                foreach (String propertyName in propertyNameChoices)
                {
                    if ((request.Inputs.Contains(propertyName + " : Property Type")) && (request.Inputs.Contains(propertyName + " : Property Value")))
                    {
                        CMInterop.modifySCCMBootImagePackage(connection, objID, request.Inputs[(propertyName + " : Property Type")].AsString(), propertyName, request.Inputs[(propertyName + " : Property Value")].AsString());
                    }
                }

                IResultObject col = null;
                col = CMInterop.getSCCMBootImagePackage(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 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 = CMInterop.connectSCCMServer(SCCMServer, userName, password);

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

                CMInterop.modifySCCMBootImagePackage(connection, objID, "IntegerValue", "PkgFlags", flagsString);
                IResultObject col = CMInterop.getSCCMBootImagePackage(connection, "PackageID LIKE '" + objID + "'");
                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Packages", ObjCount);
            }
        }
Esempio n. 3
0
        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 = CMInterop.connectSCCMServer(SCCMServer, userName, password);

            using (connection)
            {
                IResultObject col = null;
                col = CMInterop.getSCCMBootImagePackage(connection, filter);

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