In earlier versions of MDT, rules processing was supported through CustomSettings.ini and databases, from which you could retrieve values from the local computer—typically using WMI—to make decisions on what needed to be done on each computer during deployment. In addition, you could make SQL queries and stored procedure calls to retrieve additional information from external databases. There were challenges with that approach, though—especially with making secure SQL connections.

To help with this problem, MDT has the ability to make web service calls based on simple rules defined in CustomSettings.ini. These web service requests do not require any special security context and can use whatever TCP/IP port is needed to simplify firewall configurations.

Listing 10 shows how to configure CustomSettings.ini to call a particular web service. In this scenario, the web service is chosen at random from an Internet search. It takes a postal code as input and returns the city, state, area code, and time zone (as a letter) for the specified postal code.

Listing 10. CustomSettings.ini File to Call a Particular Web Service Scenario


Priority=Default, USZipService

Properties=USZip, City, State, Zip, Area_Code, Time_Zones






Executing this code produces output similar to Listing 11.

Listing 11. CustomSettings.ini File to Call a Particular Web Service Output

Added new custom property USZIP

Added new custom property CITY

Added new custom property STATE

Added new custom property ZIP

Added new custom property AREA_CODE

Added new custom property TIME_ZONES

Using from [Settings]: Rule Priority = DEFAULT, USZIPSERVICE

------ Processing the [DEFAULT] section ------

Property USZIP is now = 98052

Using from [DEFAULT]: USZIP = 98052

------ Processing the [USZIPSERVICE] section ------

Using COMMAND LINE ARG: Ini file = CustomSettings.ini


About to execute web service call to USZip=98052

Response from web service: 200 OK

Successfully executed the web service.

Property CITY is now = Redmond

Obtained CITY value from web service:  CITY = Redmond

Property STATE is now = WA

Obtained STATE value from web service:  STATE = WA

Property ZIP is now = 98052

Obtained ZIP value from web service:  ZIP = 98052

Property AREA_CODE is now = 425

Obtained AREA_CODE value from web service:  AREA_CODE = 425

------ Done processing CustomSettings.ini ------

There are a few minor complications to watch for when running a web service:

·     Do not do anything special with proxy servers. If there is an anonymous proxy present, use it, but authenticating proxies could cause problems. In most cases, a web service will not be called.

·     CustomSettings.ini or ZTIGather.xml searches for properties defined in the XML markup returned as a result of the web service call (just as with a database query or other rule). However, the XML search is case sensitive. Fortunately, the web service described here returns all uppercase property names, which is what ZTIGather.xml expects. It is possible to remap lowercase or mixed-case entries to get around this.

·     A POST request to the web service is recommended, so the web service call must be able to support a POST.

Related Topics

Microsoft Deployment Toolkit Samples Guide