Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


January 27, 2004

Device Variables


RSS
Subscribe to Windows IT Pro | See More Windows 2000 Server Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
Main Article    Automated Deployment Services

Download the Code Here

To create an OS image that will be unique to each deployed machine, you must first execute the Sysprep operation on the OS installation that you plan to image before you capture the image. Sysprep generalizes the image by removing such details as the product key, network settings, and machine SID. Immediately after image deployment, Automated Deployment Services (ADS) reads device variables and replaces the placeholder strings with the device variable values in the sysprep.inf file. ADS then reboots the deployed system into the image, which in turn lets Sysprep customize the system according to the information in sysprep.inf.

You can define the necessary variables for a device (e.g., a target server name) in the Microsoft Management Console (MMC) ADS snap-in or from the command-line (using one of the ADS command-line tools), or you can use an application developed on top of the ADS Windows Management Instrumentation (WMI) component. To use the ADS snap-in, open the device's Properties dialog box and go to the User tab, which Web figure A shows. On this tab, you can add and configure variable names and values.

ADS sequences can then read defined variables' values and use them to replace the placeholder strings in the device's Sysprep file. The sample sysprep.inf file that Listing A shows contains placeholder strings at callout A (for the TimeZone variable) and callout B (for the ComputerName and ProductKey variables). You can use any string as a placeholder, as long as bmstrrep.exe, a parsing tool that the ADS Deployment Agent executes, can distinguish the string. For example, Listing B shows an ADS sequence that personalizes such variables as ^ADS_COMPUTER_NAME^ and ^ADS_WINDOWS_PRODUCT_KEY^ in the sysprep.inf file on a target system. (Note that the placeholder string in the sysprep.inf file is enclosed between two ^ characters. You can replace these characters with any characters you want-for example, #-so long as you can easily identify the placeholder string.) The code at callout A in Listing B executes bmstrrep.exe to parse the file that the code at callout B specifies, replacing the ^ADS_WINDOWS_PRODUCT_KEY^ string with the defined value of the $ProductKey$ variable and so forth. (Note that the dollar sign-$-identifies the ADS device variables in the sequence.)

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Power Up! With Virtualization Online Conference

Don't Miss Windows Server 2008 Virtual Event

Successful SharePoint 2007 Deployment and Administration – Truly Centralizing Your SharePoint Back-End Management

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing