How to Enable a PXE Service Point Role
You enable the PXE Service Point role, in Configuration Manager, by getting an instance of a specific distribution point and setting the IsPXE
value to 1
.
To enable a PXE service point role
Set up a connection to the SMS Provider. For more information see, SMS Provider fundamentals.
Get an instance of a specific distribution point.
Set the
IsPXE
embedded property to1
.Save the distribution point instance.
Example
The following example method enables a PXE service point.
For information about calling the sample code, see Calling Configuration Manager Code Snippets.
public void EnablePXE(WqlConnectionManager connection, string siteCode, string serverName){ try { //Connect to distribution point instance. IResultObject siteRole = connection.GetInstance("SMS_SCI_SysResUse.FileType=2,ItemName=\"[\\\"Display=\\\\\\\\" + serverName + "\\\\\\\"]MSWNET:[\\\"SMS_SITE=" + siteCode + "\\\"]\\\\\\\\" + serverName + "\\\\,SMS Distribution Point\",ItemType=\"System Resource Usage\",SiteCode=" + "\"" + siteCode + "\""); // Create temporary copy of the embedded properties. Dictionary<string, IResultObject> embeddedProperties = siteRole.EmbeddedProperties; // Enumerate through the embedded properties and makes changes as needed. foreach (KeyValuePair<string, IResultObject> kvp in siteRole.EmbeddedProperties) { // Setting: IsPXE if (kvp.Value.PropertyList["PropertyName"] == "IsPXE") { // Get current property value. Console.WriteLine(); Console.WriteLine("Property: {0}", kvp.Value.PropertyList["PropertyName"]); Console.WriteLine("Current value: {0} (0 not enabled, 1 enabled)", kvp.Value.PropertyList["Value"]); // Change value to enable PXE (1 enabled, 0 not enabled). embeddedProperties["IsPXE"]["Value"].StringValue = "1"; Console.WriteLine("Setting the {0} value to {1}.", kvp.Value.PropertyList["PropertyName"], "1"); } } // Store the settings that have changed. siteRole.EmbeddedProperties = embeddedProperties; // Save the settings. siteRole.Put(); } catch (SmsException ex) { Console.WriteLine(); Console.WriteLine("Failed. Error: " + ex.InnerException.Message); }}
The example method has the following parameters:
Parameter | Type | Description |
---|---|---|
connection |
Managed: WqlConnectionManager |
A valid connection to the SMS Provider. |
siteCode |
Managed: String |
The Configuration Manager site code. |
serverName |
Managed: String |
The server name. For example, "SERVER1.DOMAIN1.COM" |
Compiling the Code
The C# example has the following compilation requirements:
Namespaces
System
System.Collections.Generic
System.Text
Microsoft.ConfigurationManagement.ManagementProvider
Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine
Assembly
microsoft.configurationmanagement.managementprovider
adminui.wqlqueryengine
Robust Programming
For more information about error handling, see About Configuration Manager Errors.
.NET Framework Security
For more information about securing Configuration Manager applications, see Configuration Manager role-based administration.
See Also
SMS_SCI_SysResUse Server WMI Class
PackNALPath Method in Class SMS_NAL_Methods
About OS deployment site role configuration
How to Set the Response Delay for a PXE Service Point
How to Set the PXE Service Point Response to All Network Interfaces
How to Set the PXE Service Point Response to PXE Requests
How to Read and Write to the Configuration Manager Site Control File by Using Managed Code
How to Read and Write to the Configuration Manager Site Control File by Using WMI