When working on deployment projects, there is often a requirement for a workstation to be customised on a location by location basis. Common workstation customisations which are applied in this manner include:
The Microsoft Deployment Toolkit (MDT) and its accompanying database offers features to tailor a workstation based on its location during a deployment. The MDT Database allows locations to be defined and a set of location specific settings can be stored against each entry. When a workstation is been deployed, an MDT database lookup determines its location and collects the relevant build settings for that location. The location is determined by carrying out a lookup of the default gateway on the target workstations assigned NIC against default gateways assigned to locations in the MDT Database. To learn more about the Microsoft Deployment Toolkit and the database supplied with MDT see http://technet.microsoft.com/en-us/solutionaccelerators/dd407791.aspx
During a mass deployment it is quite common for workstations to be built in central locations and then to be shipped to other sites for use. In these circumstances, the MDT Database location functionality may not be as useful as any database location lookups will return settings for the site at which the workstations are being built and not the site to which the workstation will be eventually shipped.
A solution to this is to use a location deployment wizard when using the MDT Database along with System Center Configuration Management (ConfigMgr) 2007 Operating System deployments (OSD) in zero touch scenarios. A location deployment wizard is an HTA that is displayed to the user/build engineer at the start of the workstation deployment process to display the location in which they are currently situated. If the location is the site at which the workstation will be based they can click next and the deployment will continue applying all the deployment settings for that site. However, the wizard allows an “override” for the detected location and allow the user/build engineer to select another location from the MDT Database. Overriding the detected location will apply all of the selected location deployment settings from the MDT Database to the workstation despite it not being at that location. This solution allows workstations to be built in a central location whilst being fully customised for their destination locations.
The location deployment wizard is an HTA that is stored in a customised ConfigMgr OSD boot image and is executed before a ConfigMgr task sequence starts. The HTA uses Operating System Media Pre-Execution Hooks (http://technet.microsoft.com/en-us/library/bb694075.aspx) to place itself before the task sequence window. The location deployment wizard allows inputs that are stored as a ConfigMgr task sequence variable. The location variable can then be used by a ConfigMgr deployment task sequence to recover settings from the MDT Database throughout the deployment (During ZTIGather phase).
The following pre-requirements should be configured in your deployment environment:
Download the location deployment wizard attached to this post and extract the files to a temporary location on the computer/server which has a ConfigMgr 2007 Console with integrated MDT console functions. There are 4 components which need to be configured in your environment for this solution to operate:
The Bootstrap.ini file contains the settings required by the Location Deployment Wizard to make the initial connection to the MDT Database. These settings need to be configured for your environment:
During OSD deployments a WinPE boot image provides the environment for deploying a workstation. ConfigMgr 2007 provides default boot images in the Operating System Deployment -> Boot Images node in the console. A new custom boot image needs to be generated containing the location deployment wizard HTA and its supporting files – this will execute when the boot image first loads on a workstation:
Locations and their associated settings need to be configured in the MDT SQL Database, these are typically configured through the interface in the MDT workbench. In the MDT workbench go to the Database >> Locations Node. Here you can add as many different locations as are required for your environment.
The CustomSettings.ini (http://technet.microsoft.com/en-us/library/bb977690.aspx) is a rules file which is used to automate deployments and setup how to query settings from the MDT Database. The location deployment wizard has its own CustomSettings.ini which is used during Gather phases in a ConfigMgr task sequence to retrieve location settings from the MDT Database. The CustomSettings.ini file included in the supplied location deployment wizard must be customised to your environment:
Once the customsettings.ini file has been updated it should be wrapped up into a ConfigMgr package (typically this is the MDT Settings package) and sent to all distribution points on your network which will be used for OSD. This rules package must be used by all Gather phases in your MDT integrated deployment task sequence to gather location settings from the MDT Database.
This post was contributed by Mark Hooks and Richard Smith, consultants with Microsoft Services – U.K.
Nice one guys, this will sure come in handy!
You guys might want to take a look at: http://www.ithastobecool.com/2009/08/17/zerotouch-for-mdt-2010-without-sccm/ as well :)
This is great! I'm having a little trouble though and hope you can help. Upon PXE-booting into WinPE, I see the "Windows is starting up..." message and then "Preparing network connections. I type in my password (password-protected PXE Service Point) and that's when the "Contoso Build Wizard" screen should appear allowing me to specify a computername and location. Instead, I see a flash (possibly the "Contoso Build Wizard" appearing and then closing) and get the window "Initialising connection to MDT Build Database" (with the Task Sequence Wizard underneath). The database initialization screen goes away after about 30 seconds and then all I see is my Task Sequence Wizard for selecting the advertised deployment task sequence for my image. I've tried hitting F8, navigating to where the LocationHTA.hta file resides and rerunning it from the WinPE command prompt, but the "Contoso Build Wizard" just appears for a second or two and then disappears again. It appears I am experiencing a login failure to SQL as I can get the following error to appear by commenting out the "On error Resume Next" command on line 113 in the LocationHTA.hta file.
An error has occurred in the script on this page.
Error: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
For non-config manager usage of similar functionality, you can utilize a modified version of Schuff's Role Selection wizard here: http://myitforum.com/cs2/blogs/jscheffelmaer/archive/2008/06.aspx
By duplicating location information into your Roles database, and utilizing this, you can create a similar functionality for MDT based LTI deployments.
With some custom modifications to this i have very similar functionality in my MDT environment for LTI, allowing "Depot Sites" to image systems for multiple locations, while still maintaining their site specific setups in the database.
Also, by kicking this off via a userexit, you can remove the need to modify your boot media for this same functionality, and everything is kept serverside. (simply reduces boot media updates)
You Guys Rock!
I received the same error until forcing it to connect using the Named Pipe protocol.
On line 117 in the LocationHTA, add np: in front of the server name.
cdrider, did you have any luck resolving your error? I am encountering the same issue.
Hi guys-thank you for this post on SCCM and LDW - it's been very helpful. Question for you though: I get the Location Deployment Wizard screen to popup right after I enter the password for the task sequence. It runs through connecting to the database and all that, gets to 100%, then just continues with the task process.
The login audits on the SQL side say that the MDT user successfully connected to the database, so not sure why I'm not receiving prompts to change the locations, language, etc.....
Any guidance would be helpful. Thanks very much.
Looks like one issue we couldn't get around was making sure that the sccm SQL server was installed locally on the SCCM 07 server. Once we did that and did the named pipes change, everything worked perfectly...
Not sure why the SQL location matters...
Can you still use the defaultgateway in customsettings.ini. I am setting location as an SCCM variable which works great if I change customsettings.ini to search on location as your example. Thing is for a "normal" install I would leave this variable blank and therefore want ztigather to pick up the location based on defaultgateway. I've tried putting BOTH Default Gateway and Location into the customsettings.ini and this works but SQL returns 2 records one for your "home" office gateway settings, then the variable you set for the other office. I can't get it to pick up just the one record. Any ideas ??
I had an issue with Windows PE connecting to the database after I had upgraded to SCCM 2007 SP2. The error was "Safety settings on this machine prohibit accessing a data source on another domain."
I have a post in my blog with the details to fix it:
I'm working on a similar setup and followed the steps outlined above. I see the same error as cdrider mentioned above if I dont modify the code Data Source=np: i.e.,
If I update the code with Data Source=np:, I see a different error which is as follows-
An error has occured in the script on this page.
Error: [DBNETLIB][ConnectionOpen (Connect())]SQL Server does not exist or access denied.
My SQL server is ver 2008 and have ensured that Named Pipes are enabled under network configuration. I can also ping the server from the client end when I see this message. Not sure what I'm missing here. Can anyone help me with you valuable inputs?
Thanks in advance.
Encountering the same kind of error as cdrider and Sridhar.
While connecting to SQL database using a HTA which is ran in WinPE during the OSD deployment.
I followed the instructions to the letter and I can't get the Location page to load before the Task Sequence
Hi "am I missing something",
Here are a couple of things that could be causing this issue:
1) If you are not seeing the location selector page at all, it suggests that the WinPE boot image with customized pre-execution hooks has not been created correctly. The Pre-execution hooks in the TSConfig.ini file force WinPE to launch the location HTA before running the ConfigMgr Task Sequence wizard.
2) If the HTA is firing but not connecting to the SQL Database, a few people have posted about having this issue (Named Pipes v’s TCP) and there is a solution for this issue in the comments above.
Thanks Ben (via Mark)
I am connecting to the share, everything is fine but I get Unable to connect to MDT Database. Same user credentials I use for everything else MDT
is LDW available for SCCM 2012 yet ?