Ejemplo n.º 1
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String CollectionID  = request.Inputs["CollectionID"].AsString();
            String variableName  = request.Inputs["Variable Name"].AsString();
            String variableValue = request.Inputs["Variable Value"].AsString();
            int    precedence    = (int)request.Inputs["Precedence"].AsUInt32();

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

            using (connection)
            {
                CMInterop.createSCCMCollectionVariable(connection, variableName, variableValue, false, CollectionID, precedence);

                response.Publish("Variable Name", variableName);
                response.Publish("Variable Value", variableValue);
                response.Publish("CollectionID", CollectionID);
            }
        }