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

            String objID             = request.Inputs["Collection ID"].AsString();
            String ruleName          = request.Inputs["Rule Name"].AsString();
            String wqlQuery          = request.Inputs["WQL Query"].AsString();
            String limitCollectionID = String.Empty;

            if (request.Inputs.Contains("Collection ID to Limit Query To"))
            {
                limitCollectionID = request.Inputs["Collection ID to Limit Query To"].AsString();
            }

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

            using (connection)
            {
                CMInterop.addSCCMCollectionRule(connection, objID, ruleName, wqlQuery, limitCollectionID);

                IResultObject col = null;
                col = CMInterop.getSCCMCollection(connection, "CollectionID 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 pkgID           = request.Inputs["Existing Package ID"].AsString();
            String prgName         = request.Inputs["Existing Program Name"].AsString();
            String prgOSMaxVersion = request.Inputs["New Max Version"].AsString();
            String prgOSMinVersion = request.Inputs["New Min Version"].AsString();
            String prgOSName       = request.Inputs["New Name"].AsString();
            String prgOSPlatform   = request.Inputs["New Platform"].AsString();

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

            using (connection)
            {
                CMInterop.modifySCCMProgramSupportedPlatforms(connection, pkgID, prgName, prgOSMaxVersion, prgOSMinVersion, prgOSName, prgOSPlatform);

                IResultObject col = CMInterop.getSCCMProgram(connection, "PackageID LIKE '" + pkgID + "' AND ProgramName LIKE '" + prgName + "'");

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Programs", ObjCount);
            }
        }
예제 #3
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 = CMInterop.connectSCCMServer(SCCMServer, userName, password);

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

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

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

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

            DateTime startTime = request.Inputs["Start Time"].AsDateTime();

            int dayDuration    = request.Inputs["Day Duration"].AsInt32();
            int hourDuration   = request.Inputs["Hour Duration"].AsInt32();
            int minuteDuration = request.Inputs["Minute Duration"].AsInt32();

            bool isGMT = request.Inputs["Is GMT"].AsBoolean();

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

            using (connection)
            {
                CMInterop.modifySCCMAdvertisementAddAssignmentScheduleNonReccuring(connection, objID, isGMT, dayDuration, hourDuration, minuteDuration, startTime);
                IResultObject col = CMInterop.getSCCMAdvertisement(connection, "AdvertisementID LIKE '" + objID + "'");
                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Advertisements", ObjCount);
            }
        }
예제 #5
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

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

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

            using (connection)
            {
                IResultObject col = CMInterop.getSCCMObject(connection, objClass, filter);

                CMInterop.removeSCCMObject(connection, filter, objClass);

                foreach (IResultObject obj in col)
                {
                    ObjCount++;
                }
                response.Publish("Number of Objects", ObjCount);
            }
        }
예제 #6
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            int referenceID   = (int)request.Inputs["Reference Computer Resource ID"].AsUInt32();
            int destinationID = (int)request.Inputs["Destination Computer Resource ID"].AsUInt32();


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

            using (connection)
            {
                CMInterop.associateComputer(connection, referenceID, destinationID);

                IResultObject col = null;
                col = CMInterop.getSCCMComputer(connection, Convert.ToString(destinationID), "", "");

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

            String objID    = request.Inputs["Collection ID"].AsString();
            String ruleName = request.Inputs["Rule Name"].AsString();

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

            using (connection)
            {
                CMInterop.removeSCCMCollectionMember(connection, objID, ruleName);

                IResultObject col = null;
                col = CMInterop.getSCCMCollection(connection, "CollectionID LIKE '" + objID + "'");

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

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

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

            using (connection)
            {
                IResultObject col = CMInterop.getSCCMObject(connection, "SMS_R_System", filter);

                List <system> systemCollection = new List <system>();
                foreach (IResultObject obj in col)
                {
                    ObjCount++;
                    systemCollection.Add(new system(obj));
                }

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

                CMInterop.removeSCCMObject(connection, filter, "SMS_R_System");
            }
        }
예제 #9
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String pkgName        = request.Inputs["New Package Name"].AsString();
            String pkgDescription = request.Inputs["New Package Description"].AsString();
            int    pkgSourceFlag  = (int)request.Inputs["New Package Source Flag"].AsUInt32();
            String pkgSourcePath  = request.Inputs["New Package Source Path"].AsString();

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

            using (connection)
            {
                IResultObject col = CMInterop.createSCCMPackage(connection, pkgName, pkgDescription, pkgSourceFlag, pkgSourcePath);

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

            String pkgID               = request.Inputs["Existing Package ID"].AsString();
            String prgName             = request.Inputs["New Program Name"].AsString();
            String prgComment          = request.Inputs["New Program Comment"].AsString();
            String prgCommandLine      = request.Inputs["New Program Command Line"].AsString();
            int    prgMaxRunTime       = (int)request.Inputs["New Program Max Runtime"].AsUInt32();
            String prgWorkingDirectory = request.Inputs["New Program Working Directory"].AsString();

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

            using (connection)
            {
                IResultObject col = CMInterop.createSCCMProgram(connection, pkgID, prgName, prgComment, prgCommandLine, prgMaxRunTime, prgWorkingDirectory);

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

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

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

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

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

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Authorization Lists", ObjCount);
            }
        }
        public void Design(IActivityDesigner designer)
        {
            WqlConnectionManager connection = CMInterop.connectSCCMServer(settings.SCCMSERVER, settings.UserName, settings.Password);

            designer.AddInput("Advertisement ID").WithDefaultValue("ABC00000");

            designer.AddInput("BATTERY_POWER").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RUN_FROM_CD").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("DOWNLOAD_FROM_CD").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RUN_FROM_LOCAL_DISPPOINT").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("DOWNLOAD_FROM_LOCAL_DISPPOINT").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("DONT_RUN_NO_LOCAL_DISPPOINT").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("DOWNLOAD_FROM_REMOTE_DISPPOINT").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RUN_FROM_REMOTE_DISPPOINT").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("DOWNLOAD_ON_DEMAND_FROM_LOCAL_DP").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("DOWNLOAD_ON_DEMAND_FROM_REMOTE_DP").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("BALLOON_REMINDERS_REQUIRED").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RERUN_ALWAYS").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RERUN_NEVER").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RERUN_IF_FAILED").WithDefaultValue(false).WithBooleanBrowser();
            designer.AddInput("RERUN_IF_SUCCEEDED").WithDefaultValue(false).WithBooleanBrowser();

            designer.AddCorellatedData(typeof(advertisement));
            designer.AddOutput("Number of Advertisements");
        }
예제 #13
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);
            }
        }
예제 #14
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String varType = request.Inputs["Variable Name"].AsString();

            MachineName = request.Inputs["Machine Name"].AsString();

            String resourceID = String.Empty;

            if (request.Inputs.Contains("Resource ID"))
            {
                resourceID = request.Inputs["Resource ID"].AsString();
            }

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

            using (connection)
            {
                //Get Computer Object
                IResultObject computerObj = null;
                IResultObject col         = null;
                if (resourceID.Equals(String.Empty))
                {
                    col = CMInterop.getSCCMComputer(connection, "", MachineName, "");
                }
                else
                {
                    col = CMInterop.getSCCMComputer(connection, resourceID, "", "");
                }

                foreach (IResultObject c in col)
                {
                    computerObj = c;
                    if (computerObj != null)
                    {
                        //Get Variables from Comoputer Object
                        List <IResultObject> variableCollection = CMInterop.getSCCMComputerVariables(connection, computerObj["ResourceID"].IntegerValue.ToString());

                        if (variableCollection != null)
                        {
                            response.WithFiltering().PublishRange(getComputerVariables(variableCollection));
                            response.Publish("Number of Machine Variables", variableCollection.Count);
                        }
                        response.Publish("Number of Machine Variables", 0);
                    }
                    else
                    {
                        response.LogErrorMessage("Could Not Find Computer " + MachineName);
                    }
                }
            }
        }
예제 #15
0
        public void Design(IActivityDesigner designer)
        {
            WqlConnectionManager connection = CMInterop.connectSCCMServer(settings.SCCMSERVER, settings.UserName, settings.Password);

            designer.AddInput("Netbios Name").WithDefaultValue("computerName");
            designer.AddInput("SM Bios GUID").NotRequired();
            designer.AddInput("MAC Address").NotRequired();

            designer.AddCorellatedData(typeof(system));
            designer.AddOutput("Number of Systems");
        }
예제 #16
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 = CMInterop.connectSCCMServer(SCCMServer, userName, password);

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

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

            String pkgID                    = request.Inputs["Existing Package ID"].AsString();
            String prgName                  = request.Inputs["Existing Program Name"].AsString();
            String colID                    = request.Inputs["Existing Collection ID"].AsString();
            String advName                  = request.Inputs["New Advertisement Name"].AsString();
            String advComment               = request.Inputs["New Advertisement Comment"].AsString();
            int    advFlags                 = (int)request.Inputs["New Advertisement Flags"].AsUInt32();
            String advStartDate             = request.Inputs["New Advertisement Start Date"].AsString();
            String advStartOfferEnabled     = request.Inputs["New Advertisement Start Offer Enabled"].AsString();
            String advIncludeSubCollections = request.Inputs["New Advertisement Include Sub Collection"].AsString();

            bool advertStartOfferEnabled = true;

            switch (advStartOfferEnabled)
            {
            case "True":
                advertStartOfferEnabled = true;
                break;

            case "False":
                advertStartOfferEnabled = false;
                break;
            }

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

            using (connection)
            {
                IResultObject col = CMInterop.createSCCMAdvertisement(connection, colID, pkgID, prgName, advName, advComment, advFlags, advStartDate, advertStartOfferEnabled);


                //If advetisement should not include subcollection modify that property
                if (advIncludeSubCollections.Equals("False"))
                {
                    CMInterop.modifySCCMAdvertisement(connection, col["AdvertisementID"].StringValue, "BooleanValue", "includeSubCollection", "False");
                }

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

            String colComment      = String.Empty;
            int    colRefreshMin   = 0;
            int    colRefreshHours = 0;
            int    colRefreshDays  = 0;
            String parentColID     = String.Empty;

            String colName = request.Inputs["New Collection Name"].AsString();

            if (request.Inputs.Contains("New Collection Comment"))
            {
                colComment = request.Inputs["New Collection Comment"].AsString();
            }
            if (request.Inputs.Contains("New Collection Refresh Minutes"))
            {
                colRefreshMin = (int)request.Inputs["New Collection Refresh Minutes"].AsUInt32();
            }
            if (request.Inputs.Contains("New Collection Refresh Hours"))
            {
                colRefreshHours = (int)request.Inputs["New Collection Refresh Hours"].AsUInt32();
            }
            if (request.Inputs.Contains("New Collection Refresh Days"))
            {
                colRefreshDays = (int)request.Inputs["New Collection Refresh Days"].AsUInt32();
            }
            if (request.Inputs.Contains("New Collection Parent CollectionID"))
            {
                parentColID = request.Inputs["New Collection Parent CollectionID"].AsString();
            }

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

            using (connection)
            {
                IResultObject col = CMInterop.createSCCMCollection(connection, colName, colComment, colRefreshMin, colRefreshHours, colRefreshDays, parentColID);

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

            String colId = request.Inputs["Collection ID"].AsString();

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

            using (connection)
            {
                List <IResultObject> results = CMInterop.getSCCMCollectionVariables(connection, colId);
                response.WithFiltering().PublishRange(getObjectProperties(results));
                response.Publish("Number of Collection Variables", objCount);
            }
        }
예제 #20
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 membershipType = request.Inputs["Direct Membership Type"].AsString();
            int    resourceID     = (int)request.Inputs["ResourceID"].AsUInt32();

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

            using (connection)
            {
                switch (membershipType)
                {
                case "System":
                    CMInterop.addDirectSCCMCollectionMemberMachine(connection, objID, resourceID);
                    break;

                case "User":
                    CMInterop.addDirectSCCMCollectionMemberUser(connection, objID, resourceID);
                    break;

                case "User Group":
                    CMInterop.addDirectSCCMCollectionMemberUserGroup(connection, objID, resourceID);
                    break;

                default:
                    response.LogErrorMessage("Invalid Direct Membership Type");
                    break;
                }

                IResultObject col = null;
                col = CMInterop.getSCCMCollection(connection, "CollectionID LIKE '" + objID + "'");

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

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

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

            using (connection)
            {
                IResultObject col = CMInterop.getSCCMPackage(connection, "PackageID LIKE '" + pkgID + "'");
                CMInterop.deleteSCCMPackage(connection, pkgID);

                response.Publish("Number of Packages", ObjCount);
            }
        }
예제 #22
0
        public void Design(IActivityDesigner designer)
        {
            designer.AddInput("CI_ID").WithDefaultValue("11189");

            //Setup WQL Connection and WMI Management Scope
            WqlConnectionManager connection = CMInterop.connectSCCMServer(settings.SCCMSERVER, settings.UserName, settings.Password);

            String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_AuthorizationList");
            String[] propertyTypeChoices = new String[] { "StringValue", "DateTimeValue", "IntegerValue", "BooleanValue" };

            foreach (String propertyName in propertyNameChoices)
            {
                designer.AddInput(propertyName + " : Property Type").WithListBrowser(propertyTypeChoices).WithDefaultValue("StringValue").NotRequired();
                designer.AddInput(propertyName + " : Property Value").NotRequired();
            }

            designer.AddCorellatedData(typeof(authorizationList));
            designer.AddOutput("Number of Authorization Lists");
        }
예제 #23
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String argType   = request.Inputs["Argument Type"].AsString();
            String argString = request.Inputs["Argument String"].AsString();

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

            using (connection)
            {
                IResultObject col = null;

                //Get Computer Collection
                switch (argType)
                {
                case "ResourceID":
                    col = CMInterop.getSCCMUser(connection, argString, "", "");
                    break;

                case "UserName":
                    col = CMInterop.getSCCMUser(connection, "", argString, "");
                    break;

                case "DomainName":
                    col = CMInterop.getSCCMUser(connection, "", "", argString);
                    break;

                case "Query":
                    col = CMInterop.getSCCMObject(connection, "SMS_R_User", argString);
                    break;
                }

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

            int nodeID = request.Inputs["Folder ID"].AsInt32();

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

            using (connection)
            {
                CMInterop.deleteConsoleFolder(connection, nodeID);

                ObjCount++;

                response.Publish("Number of Object Container Nodes", ObjCount);
            }
        }
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String siteCode   = request.Inputs["Site Code"].AsString();
            String serverName = request.Inputs["SUP Server Name"].AsString();

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

            using (connection)
            {
                CMInterop.synchronizeSCCMSoftwareUpdatePoint(connection, siteCode, serverName);

                response.Publish("Site Code", siteCode);
                response.Publish("Server Name", serverName);
            }
        }
예제 #26
0
        public void Design(IActivityDesigner designer)
        {
            designer.AddInput("Package ID").WithDefaultValue("ABC00000");
            //Setup WQL Connection and WMI Management Scope
            WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password);

            using (connection)
            {
                String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_ImagePackage");
                String[] propertyTypeChoices = new String[] { "StringValue", "DateTimeValue", "IntegerValue", "BooleanValue" };

                foreach (String propertyName in propertyNameChoices)
                {
                    designer.AddInput(propertyName + " : Property Type").WithListBrowser(propertyTypeChoices).WithDefaultValue("StringValue").NotRequired();
                    designer.AddInput(propertyName + " : Property Value").NotRequired();
                }

                designer.AddCorellatedData(typeof(imagePackage));
                designer.AddOutput("Number of Packages");
            }
        }
예제 #27
0
        public void Design(IActivityDesigner designer)
        {
            designer.AddInput("Advertisement ID").WithDefaultValue("ABC00000");

            WqlConnectionManager connection = CMInterop.connectSCCMServer(settings.SCCMSERVER, settings.UserName, settings.Password);

            using (connection)
            {
                String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_Advertisement");
                String[] propertyTypeChoices = new String[] { "StringValue", "DateTimeValue", "IntegerValue", "BooleanValue" };

                foreach (String propertyName in propertyNameChoices)
                {
                    designer.AddInput(propertyName + " : Property Type").WithListBrowser(propertyTypeChoices).WithDefaultValue("StringValue").NotRequired();
                    designer.AddInput(propertyName + " : Property Value").NotRequired();
                }

                designer.AddCorellatedData(typeof(advertisement));
                designer.AddOutput("Number of Advertisements");
            }
        }
예제 #28
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String collectionID = request.Inputs["Collection ID"].AsString();
            String variableName = request.Inputs["Variable Name"].AsString();


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

            using (connection)
            {
                CMInterop.deleteSCCMCollectionVariable(connection, variableName, collectionID);

                response.Publish("Variable Name", variableName);
                response.Publish("Collection ID", collectionID);
            }
        }
예제 #29
0
        public void Execute(IActivityRequest request, IActivityResponse response)
        {
            SCCMServer = settings.SCCMSERVER;
            userName   = settings.UserName;
            password   = settings.Password;

            String   assignmentName                  = request.Inputs["Assignment Name"].AsString();
            bool     applyToSubTargets               = request.Inputs["Apply To Sub Targets"].AsBoolean();
            String   assignedCIs                     = request.Inputs["Assigned CIs (CSV)"].AsString();
            String   description                     = request.Inputs["Assignment Description"].AsString();
            int      action                          = (int)request.Inputs["Assignment Action"].AsUInt32();
            int      desiredConfigType               = (int)request.Inputs["Desired Config Type"].AsUInt32();
            int      dpLocality                      = (int)request.Inputs["DP Locality"].AsUInt32();
            int      localeID                        = (int)request.Inputs["Locale ID"].AsUInt32();
            bool     logComplianceToWinEvent         = request.Inputs["Log Compliace To Windows Event Log"].AsBoolean();
            bool     notifyUser                      = request.Inputs["Notify User"].AsBoolean();
            bool     raiseMOMAlertOnFailure          = request.Inputs["Raise MOM Alert of Failure"].AsBoolean();
            bool     readOnly                        = request.Inputs["Read Only"].AsBoolean();
            bool     sendDetailedNonComplianceStatus = request.Inputs["Send Detailed Non Compliance Status"].AsBoolean();
            DateTime startTime                       = Convert.ToDateTime(request.Inputs["Start Time"].AsString());
            int      suppressReboot                  = (int)request.Inputs["Suppress Reboot"].AsUInt32();
            String   targetCollectionID              = request.Inputs["Target Collection ID"].AsString();
            bool     useGMTTimes                     = request.Inputs["Use GMT Times"].AsBoolean();

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

            using (connection)
            {
                IResultObject col = CMInterop.createSCCMUpdatesAssignment(connection, applyToSubTargets, assignedCIs, action, description, assignmentName, desiredConfigType, dpLocality, localeID, logComplianceToWinEvent, notifyUser, raiseMOMAlertOnFailure, readOnly, sendDetailedNonComplianceStatus, startTime, suppressReboot, targetCollectionID, useGMTTimes);

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

            String netBiosName = null;
            String macAddress  = null;
            String smBiosGuid  = null;

            netBiosName = request.Inputs["Netbios Name"].AsString();

            if (request.Inputs.Contains("SM Bios GUID"))
            {
                smBiosGuid = request.Inputs["SM Bios GUID"].AsString();
            }
            if (request.Inputs.Contains("MAC Address"))
            {
                macAddress = request.Inputs["MAC Address"].AsString();
            }

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

            using (connection)
            {
                int resourceID = CMInterop.addNewComputer(connection, netBiosName, smBiosGuid, macAddress);

                IResultObject col = null;
                col = CMInterop.getSCCMComputer(connection, Convert.ToString(resourceID), "", "");

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