C# Install SCCM Package on Client
I needed to be able to kick of an installation of a SCCM Package on a client from a C# windows form. I discovered the SDKClient WMI Namespace and am using the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
//Populate Listview with Packages try { ManagementObjectSearcher searcher = new ManagementObjectSearcher(wmipath, select); ManagementObjectCollection instances = searcher.Get(); foreach (ManagementObject queryObj in instances) { if (queryObj["FullName"].ToString().StartsWith("Package")) { ListViewItem lvi = new ListViewItem(); lvi.Name = queryObj["FullName"].ToString(); lvi.Text = queryObj["Description"].ToString(); lvi.Tag = queryObj["ProgramID"].ToString() + "^" + queryObj["PackageID"].ToString(); lvi.ToolTipText = queryObj["Description"].ToString(); this.ListView1.Items.Add(lvi); } } } catch { } private void btnRun_Click(object sender, EventArgs e) { try { // Split ProgramID and PackageID out form string string[] progInfo = listTopSolutions.SelectedItems[0].Tag.ToString().Split('^'); programID = progInfo[0]; packageID = progInfo[1]; // Get the object on which the method will be invoked ManagementClass processClass = new ManagementClass(@"root\ccm\clientsdk", "CCM_ProgramsManager", null); // Get an input parameters object for this method ManagementBaseObject inParams = processClass.GetMethodParameters("ExecuteProgram"); // Fill in input parameter values inParams["ProgramID"] = programID; inParams["PackageID"] = packageID; // Execute the method ManagementBaseObject outParams = processClass.InvokeMethod("ExecuteProgram", inParams, null); } catch { } |

Deploying Office 365 using System Center Configuration Manager
This article walks you through preparing and deploying Office 365. Download and install the Office Deployment tools from here. https://www.microsoft.com/en-us/download/details.aspx?id=36778With O365 configurations are done using the Office Deployment Tool for Click to Run and .xml files verses the Customization Toolkit and .msp files that are used in the volume license .msi version Browse to the folder that […]