예제 #1
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            int objID = (int)request.Inputs["Driver CI_ID"].AsUInt32();

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

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

                IResultObject col = null;
                col = CMInterop.getSCCMDriver(connection, "CI_ID LIKE '" + Convert.ToString(objID) + "'");

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Drivers", ObjCount);
            }
        }
예제 #2
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.getSCCMDriver(connection, filter);

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