How to Enable Unknown Computer Support for a PXE Service Point
In Configuration Manager, you set the operating system deployment PXE service point response to incoming PXE requests from unknown computers by setting the SupportUnknownMachines embedded property.
SupportUnknownMachines has the following possible values.
Value | Description |
---|---|
0 | The PXE service point does not respond to PXE requests from unknown computers. |
1 | The PXE service point responds to requests from unknown computers. |
To set the PXE service point response to PXE requests from unknown computers
Set up a connection to the SMS Provider. For more information, see SMS Provider fundamentals.
Make a connection to the distribution point instance with PXE enabled.
Get the embedded properties.
Update the SupportUnknownMachines embedded property.
Commit the changes to the site control file.
Example
The following example method sets the response for a PXE request based on the supplied String
value (allowResponse
).
For information about calling the sample code, see Calling Configuration Manager Code Snippets.
public void EnablePXE(WqlConnectionManager connection, string siteCode, string serverName, string allowResponse){ 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: SupportUnknownMachines if (kvp.Value.PropertyList["PropertyName"] == "SupportUnknownMachines") { // Get current property value. Console.WriteLine(); Console.WriteLine("Property: {0}", kvp.Value.PropertyList["PropertyName"]); Console.WriteLine("Current value: {0}", kvp.Value.PropertyList["Value"]); // Change value. embeddedProperties["SupportUnknownMachines"]["Value"].StringValue = allowResponse; Console.WriteLine("Setting the {0} value to {1}.", kvp.Value.PropertyList["PropertyName"], allowResponse); } } // 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" . |
allowResponse |
Managed: String |
The value to set whether the PXE service point will respond to unknown computers. - 0 - The PXE service point does not respond to PXE requests from unknown computers. - 1 - The PXE service point responds to requests from unknown computers. |
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
About OS deployment site role configuration
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for