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)
To remove the setting place a Run Command just before the Prepare to Capture Image group to execute cscript CFG-ClearProxySetting.wsf
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
Great post over on The Deployment Guys by Richard Smith. Read the full post and download the scripts
Les DeploymentGuys viennent de publier un billet concernant l’utilisation de la tâche Windows
Brilliant, thanks for that - it'll make my life a lot easier.
our proxy server setting need the user type in Username and Password when they connect internet. So, how do you deal with this? Thanks.
how do you deal with this case which the proxy ask the username and password?
How do you deal when you have a username and password to give?
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.
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
We have now uploaded a new version of the script.
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.
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.