Using the MDT Windows Update Tasks in Image Engineering


A request that I have had from a number of customers lately goes like this:

we would like to have MDT 2010 download and apply all critical and security updates during image engineering from the Internet, but the device we are using as a reference machine is in the lab network which doesn’t get Group Policy applied and which therefore doesn’t get the proxy server settings required to connect to the Internet” I covered this scenario in a previous post where I discussed using the inbuilt MDT 2010 tasks for applying Windows Updates and how this can streamline the image engineering process.

To enable the reference device to connect to the Internet during Image Engineering, I have a pair of scripts that are added to the task sequence which configure the proxy settings (first script) and then remove the proxy settings (second script) prior to image capture.

The script examples attached to this post should be extracted from the zip file and dropped into the scripts folder in your MDT 2010 Deployment Share

You should then add a Run Command task around where the Tatoo task is in the State Restore phase of your task sequence to execute the first script as cscript CFG-ProxySetting.wsf /Proxy:<Proxyname.company.com or IP Address>:<Port> /Exceptions:local – replacing the command line options with your own proxy server details

for example – cscript CFG-ProxySetting.wsf /Proxy:PROXYSRV01.CONTOSO.COM:8080 /Exceptions:local (you must use both the /Proxy: and /Exceptions: command line options)

blog1

To remove the setting place a Run Command just before the Prepare to Capture Image group to execute cscript CFG-ClearProxySetting.wsf

Blog2

You could combine these two scripts into a single script with a little re-writing to use command line arguments to add the proxy (/AddProxy) and clear the proxy (/ClearProxy) if you wanted to be efficient in your custom script use.

The script is available for download below.

This post was contributed by Richard Smith, a Senior Consultant with Microsoft Services UK

Disclaimer: The information on this site is provided “AS IS” with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use

Proxy Scripts.zip

Comments (13)

  1. Anonymous says:

    Great post over on The Deployment Guys by Richard Smith. Read the full post and download the scripts

  2. Anonymous says:

    Hi,

    our proxy server setting need the user type in Username and Password when they connect internet. So, how do you deal with this? Thanks.

  3. Anonymous says:

    how do you deal with this case which the proxy ask the username and password?

    Thanks.

  4. Anonymous says:

    Hi,

    our proxy server setting need the user type in Username and Password when they connect internet. So, how do you deal with this? Thanks.

  5. Anonymous says:

    how do you deal with this case which the proxy ask the username and password?

    Thanks.

  6. Anonymous says:

    Hi Mark,

    We have now uploaded a new version of the script.

    Thanks,

    Ben

  7. Anonymous says:

    Les DeploymentGuys viennent de publier un billet concernant l’utilisation de la tâche Windows

  8. Kieran Walsh says:

    Brilliant, thanks for that – it'll make my life a lot easier.

  9. Karl says:

    How do you deal when you have a username and password to give?

  10. Antho says:

    How can I pass the proxy.pac url instead of using directly the proxy server ?

    When I use AutoconfigURL registry key it doesn't work as expected.

  11. Arjan Versloot says:

    I'm using MDT 2012, and it works when I changed it to:

    cscript.exe "%SCRIPTROOT%CFG-ProxySetting.wsf" /Proxy:proxy.address.local:8080 /Exceptions:local

    Thanks.

  12. BobCat says:

    Couple things: The exceptions should have angle brackets around local, as in , for that to stick. Although these settings are applied, I cannot figure out how to make the system recognize them. If I launch IE, the settings get picked up. If not, I get
    0x80072EFD -2147012867 ERROR_INTERNET_CANNOT_CONNECT in ZTIWindowsUpdate. The removal script did not work, though the logs show success.

  13. Clif says:

    I am having the same issue the logs say the command complete successfully. But proxy is not set when I go to inetcpl.cpl in a f8 session.