Ejemplo n.º 1
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 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 = CM2012Interop.connectSCCMServer(SCCMServer, userName, password);

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

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

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Programs", ObjCount);
            }
        }
Ejemplo n.º 2
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 = CM2012Interop.connectSCCMServer(SCCMServer, userName, password);

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

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

                if (col != null)
                {
                    response.WithFiltering().PublishRange(getObjects(col));
                }
                response.Publish("Number of Systems", ObjCount);
            }
        }
Ejemplo n.º 3
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 = CM2012Interop.connectSCCMServer(SCCMServer, userName, password);

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

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

                CM2012Interop.removeSCCMObject(connection, filter, "SMS_R_System");

                if (systemCollection != null)
                {
                    response.WithFiltering().PublishRange(getObjects(systemCollection));
                }
                response.Publish("Number of Systems", ObjCount);
            }
        }
Ejemplo n.º 4
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 = CM2012Interop.connectSCCMServer(SCCMServer, userName, password);

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

                foreach (IResultObject c in col)
                {
                    computerObj = c;
                    if (computerObj != null)
                    {
                        //Get Variables from Comoputer Object
                        List <IResultObject> variableCollection = CM2012Interop.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);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public void Design(IActivityDesigner designer)
        {
            WqlConnectionManager connection = CM2012Interop.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");
        }