Dela via


How to Set the PXE Service Point Response to Network Interfaces

Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2

In Microsoft System Center Configuration Manager 2007, you set the operating system deployment PXE service point response to network interfaces by setting the BindPolicy embedded property.

BindPolicy has the following possible values.

Value Description

0

Responds to PXE requests on all network interfaces.

1

Responds to requests on specific network interfaces

If BindPolicy is set to respond to specific network interfaces (1), you must add the media access control (MAC) addresses for the required network interfaces by using the BindExcept list. If BindExcept is not populated, PXE will not respond to any requests. For more information see, How to Set the PXE Service Point Response for a Specific Network Interface.

To set the PXE response to network interfaces

  1. Set up a connection to the SMS Provider. For more information, see About the SMS Provider in Configuration Manager.

  2. Make a connection to the PXE service point resources section of the site control file.

  3. Get the embedded properties.

  4. Update the BindPolicy embedded property.

  5. Commit the changes to the site control file.

Example

The following example method sets the PXE service point response to a network interface. If respondToSpecificInterface is set to true you must set the BindExcept list to specify the network interfaces that can respond. For more information, see How to Set the PXE Service Point Response for a Specific Network Interface.

For information about calling the sample code, see Calling Configuration Manager Code Snippets.

Sub SetNetworkInterfaceAll(connection,          _
                           context,           _
                           siteCode,               _
                           respondToSpecificInterface)
 
    ' Load site control file and get SMS PXE service point section.
    connection.ExecMethod "SMS_SiteControlFile.Filetype=1,Sitecode=""" & siteCode & """", "Refresh", , , context
        
    Query = "SELECT * FROM SMS_SCI_SysResUse " & _
            "WHERE RoleName = 'SMS PXE Service Point' " & _
            "AND SiteCode = '" & siteCode & "'"
    
    Set SCIComponentSet = connection.ExecQuery(Query, , , context)
                       
    ' Only one instance is returned from the query.
    For Each SCIComponent In SCIComponentSet

         ' Display SMS PXE service point server name.
         wscript.echo "SMS PXE Service Point Server: " & SCIComponent.NetworkOSPath                                    
    
        'Loop through the array of embedded property instances.
        For Each vProperty In SCIComponent.Props
            
            ' Setting: BindPolicy
            If vProperty.PropertyName = "BindPolicy" Then
                wscript.echo " "
                wscript.echo vProperty.PropertyName
                wscript.echo "Current value " &  vProperty.Value               
                
                ' Modify the value.
                vProperty.Value = respondToSpecificInterface
                wscript.echo "New value " & respondToSpecificInterface
            End If
 
               
        Next   

             ' Update the component in your copy of the site control file. Get the path
             ' to the updated object, which could be used later to retrieve the instance.
             Set SCICompPath = SCIComponent.Put_( , context)
    Next
                          
    ' Commit the change to the actual site control file.
    Set InParams = connection.Get("SMS_SiteControlFile").Methods_("CommitSCF").InParameters.SpawnInstance_
    InParams.SiteCode = siteCode
    connection.ExecMethod "SMS_SiteControlFile", "CommitSCF", InParams, , context
      
End Sub
public void SetNetworkInterfaceAll(
    WqlConnectionManager connection, 
    string server, 
    string siteCode, 
    bool respondToSpecificInterface)
{
    try
    {
        // Get PXE properties.
        IResultObject ro = connection.GetInstance("SMS_SCI_SysResUse.FileType=2,ItemName='[\"Display=\\\\" + 
            server + "\\\"]MSWNET:[\"SMS_SITE=" + 
            siteCode + "\"]\\\\" + 
            server + "\\,SMS PXE Service Point',ItemType='System Resource Usage',SiteCode='" + 
            siteCode + "'");

        Dictionary<string, IResultObject> embeddedProperties = ro.EmbeddedProperties; // Get a copy.

        // Update bind policy.
        embeddedProperties["BindPolicy"]["Value"].BooleanValue = respondToSpecificInterface;
        ro.EmbeddedProperties = embeddedProperties;

        // Commit changes.
        ro.Put();
    }
    catch (SmsException e)
    {
        Console.WriteLine("Failed to set PXE response for network interfaces: " + e.Message);
        throw;
    }
}

The example method has the following parameters:

Parameter

Type

Description

connection

  • Managed: WqlConnectionManager

  • VBScript: SWbemServices

A valid connection to the SMS Provider.

context (VBScript)

  • VBScript: SWbemContext

A valid context object. For more information, see How to Add a Configuration Manager Context Qualifier by Using WMI.

server

  • Managed: String

  • VBScript: String

The Configuration Manager server.

siteCode

  • Managed: String

  • VBScript: String

The Configuration Manager site code.

respondToSpecificInterface

  • Managed: Boolean

  • VBScript: Boolean

Indicates the response type.

If true, specific network interfaces must be specified; otherwise, false, which means all requests are accepted.

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.

Security

For more information about securing Configuration Manager applications, see About Securing Configuration Manager Applications.

See Also

Concepts

About Operating System Deployment Site Role Configuration
Configuration Manager Operating System Deployment
Configuration Manager Programming Fundamentals
Configuration Manager Site Control File
How to Set the PXE Service Point Response for a Specific Network Interface
Operating System 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