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

            String DisplayName    = request.Inputs["Display Name"].AsString();
            String Description    = request.Inputs["Description"].AsString();
            String InformativeURL = request.Inputs["Informative URL"].AsString();
            String LocaleID       = request.Inputs["LocaleID"].AsString();
            String UpdatesList    = request.Inputs["Updates List (CSV)"].AsString();

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

            using (connection)
            {
                try
                {
                    IResultObject col = CMInterop.createSCCMAuthorizationList(connection, DisplayName, Description, InformativeURL, LocaleID, UpdatesList);
                    if (col != null)
                    {
                        response.WithFiltering().PublishRange(getObjects(col));
                    }
                }
                catch (Exception ex)
                {
                    response.LogErrorMessage(ex.Message);
                }

                response.Publish("Number of Packages", ObjCount);
            }
        }