Windows Tips & Tricks UPDATE, March 28, 2005, —brought to you by the Windows IT Pro Network and the Windows 2000 FAQ site
http://www.windows2000faq.com

Make sure your copy of Windows Tips & Tricks UPDATE isn't mistakenly blocked by antispam software! Be sure to add Windows_TipsandTricks_UPDATE@list.windowsitpro.com to your list of allowed senders and contacts.

This email newsletter comes to you free and is supported by the following advertisers, which offer products and services in which you might be interested. Please take a moment to visit these advertisers' Web sites and show your support for Windows Tips & Tricks UPDATE.

EMC Dantz
http://www.windowsitpro.com/whitepapers/emcdantz/diskbasedbackup/index.cfm?code=t&tnl_0328

Free White Paper: Measuring the ROI of Systems Management Software http://www.argent.com/w/whitepapers_ema.html?Source=WNT
http://www.argent.com/w/whitepapers_ema.html?Source=WNT


Sponsor: EMC Dantz

Learn how small and midsize businesses (SMBs) and distributed enterprises can optimize disk-based backup! Storage industry experts have identified backup and recovery as a major area of concern for SMBs and distributed enterprises. EMC Dantz, the maker of award-winning Retrospect backup and recovery software, is offering a free white paper describing how combining disk-based backups with automated backup technology can deliver easy-to-manage backups, fast restores, and simplified creation and tracking of tape for offsite media rotation. Download the white paper today!
http://www.windowsitpro.com/whitepapers/emcdantz/diskbasedbackup/index.cfm?code=t&tnl_0328


FAQs

  • Q. How can I update the Microsoft Windows Preinstallation Environment (WinPE) 2004 instance that the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack uses?
  • Q. How can I dynamically choose which Microsoft Systems Management Server (SMS) OS Deployment Feature Pack OS program to deploy, depending on the client hardware?
  • Q. What variables do I need to define in the script that I use to choose the OS program for deploying an OS image via the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack?
  • Q. How can I use a VBScript script to read Windows Management Instrumentation (WMI) information?
  • Q. How can I troubleshoot custom scripts I created to use with the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack?

Commentary
by John Savill, FAQ Editor, jsavill@windowsitpro.com

In this issue, I tell you how to update the Microsoft Windows Preinstallation Environment (WinPE) 2004 instance that the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack uses and how to dynamically choose which OS Deployment Feature Pack OS program to deploy, depending on the client hardware. I also tell you which variables you need to define in the script that you use to choose the OS program for deploying an OS image and how to troubleshoot that script.


Sponsor: Free White Paper: Measuring the ROI of Systems Management Software

Argent delivers what a growing number of enterprises need today: flawless management of Windows, UNIX, and application servers; low total cost of ownership; flexible configuration; scalable architecture; modular products; positive ROI; and outstanding customer support. Every enterprise IT department wants value without sacrificing performance, and that describes Argent's value proposition. To read the entire paper, click here:
http://www.argent.com/w/whitepapers_ema.html?Source=WNT


FAQs

Q. How can I update the Microsoft Windows Preinstallation Environment (WinPE) 2004 instance that the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack uses?

A. If you've created a new WinPE 2004 instance--for example, one that has integrated Windows Management Instrumentation (WMI), Windows Script Host (WSH), and ADO and want to use this installation with the SMS OS Deployment Feature Pack (so that you can run custom scripts), perform these steps:

  1. Start the Microsoft Management Console (MMC) SMS Administrator Console snap-in (Start, Programs, Systems Management Server, SMS Administrator Console).
  2. Right-click Image Packages and select Update Windows PE from the All Tasks context menu.
  3. Click Next at the "Welcome to the Update Windows PE Wizard" screen.
  4. Select the source of the new WinPE instance and click Next.
  5. The wizard will create a new WinPE .wim file that contains the new WinPE environment and integrated SMS OS Deployment Feature Pack components.
  6. Click Finish. The new WinPE .wim file will be created in the \sms\osd folder as osdwinpe.wim, and the existing file will be renamed to osdwinpe.wim.0.

If you want the new WinPE .wim file to be used when you upgrade your OS via a package, right-click the OS package and select Update Operating System Package Files from the All Tasks menu. Doing so places the updated WinPE .wim file in the package of the selected OS. You then need to update the distribution points.

Q. How can I dynamically choose which Microsoft Systems Management Server (SMS) OS Deployment Feature Pack OS program to deploy, depending on the client hardware?

A. In the standard SMS OS Deployment Feature Pack OS program properties, you can select custom actions for the Feature Pack to perform at each of the five deployment phases. These actions can be scripts that you've written to perform certain actions. However, these scripts are part of a particular OS deployment program that's already been chosen and thus can't be used to determine which OS deployment program to use. If you want to use a script to actually decide which OS deployment program to use (e.g., according to the machine type) or by performing a lookup against an SQL database, you need to select a special option when you create the Operating System Image Installation CD-ROM. You do so by performing these steps:

  1. Start the Microsoft Management Console (MMC) SMS Administrator Console snap-in (Start, Programs, Systems Management Server, SMS Administrator Console).
  2. Right-click Image Packages and select Create Operating System Image Installation CD from the All Tasks context menu.
  3. Click Next at the "Welcome to the Update Windows PE Wizard" screen.
  4. Clear the "Allow installation of Operating System Packages from a location provided by the local computer installer" check box and the "Allow the local computer installer to choose the name of the new computer" check box. Leave the first check box "Allow installation of Operating System Packages from SMS distribution points" checked. Then select the "Automatically choose the Operating System Package to install by running a custom program or script" check box, as the figure at http://www.windowsitpro.com/articles/images/smsosdcustomscript1.gif shows. Click Next.
  5. Select the OSs that might be installed, as decided by the script (it's usually best to check them all). Click Next.
  6. Enter the name of the script to run that will select the OS package and program to deploy. This name must be a Universal Naming Convention (UNC) pathname because the script isn't part of the installation CD-ROM. Instead, the OS Deployment shell reads it from the share each time the OS Deployment shell execution needs it (which means that you don't need to rebuild the image installation CD-ROM every time you change the script). You also need to enter user credentials that allow access to the share in which the script is located, as the figure at http://www.windowsitpro.com/articles/images/smsosdcustomscipt2.gif shows. Click Next.
  7. As the wizard finishes, you'll need to specify any additional network or SCSI drivers, a group name for the machines that are deploying the OS, and a filename for the ISO file to create.

Remember that the Microsoft Windows Preinstallation Environment (WinPE) installation that's included in the SMS OS Deployment Feature Pack doesn't support things such as database access or Windows Management Instrumentation (WMI); therefore, to perform such functions, you need to create a custom WinPE installation.

As I stated earlier, the specified script isn't stored as part of the OS image CD-ROM. The reference to the script and the credentials used to access it are stored in the ripinfo.ini file, which is located in the root directory of the CD-ROM you create. You can view the file by using any text editor. The following sample ripinfo.ini file shows the reference to the script you specified in the \[UserCommand\] section.

  \[RIPInfo\]  Images=3  LocalImage=No  WizTitle=Zero Touch  AllowMachineName=No  SiteCode=ZTI  ManagementPoint=VSZTISRV01:80  Reserved1=3481EDDF7314AFCC9E63478E4013CC969D279174737F543F0A92637BDC62974    655C550F2C763E1  Reserved2=90095A2C81AC0D402BC4CC969D279174737F543F0A92637BDC6297FCD7C86B    BD2781CF0257853E  Reserved3=EAE8C16CBA12AE9B83F0AE9B83FDE50695439C19F7  \[UserCommand\]  CommandLine=""\\Vsztisrv01\OSDXtra\osd_install.vbs" "  NetworkShare=\\Vsztisrv01\OSDXtra  Reserved1=56F391D60214ADB7E50F5E828D199E1404C9EE4055B4E8415FB4029FD543CB6    D58EDA2B4D5D28  Reserved2=EC7B2625F004C9C68684170F1099E1404C9C68684170F10CEC555A6FC21BA36    E9CA80F1052424  Reserved3=939121480428DFC4A73CF4AE9B83FDSFDSF3B3DA9BC  \[ImageInfo1\]  DisplayName=WindowsServer2003Std - Windows2003Std  PackageID=ZTI00006  ProgramName=Windows2003Std  \[ImageInfo2\]  DisplayName=WindowsXPProSP2 - WindowsXPProSP2Base  PackageID=ZTI00007  ProgramName=WindowsXPProSP2Base  \[ImageInfo3\]  DisplayName=WindowsXPProSP2 - WindowsXPProSP2Loaded  PackageID=ZTI00007  ProgramName=WindowsXPProSP2Loaded    

Q. What variables do I need to define in the script that I use to choose the OS program for deploying an OS image via the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack?

A. You need to set the OSDINSTALLPACKAGE, OSDINSTALLPROGRAM, and the OSDINSTALLSILENT variables. If the installation is a zero-touch installation (i.e., no user input), you also need to set the OSDNEWMACHINENAME variable.

The OSDINSTALLPACKAGE variable isn't the "friendly" name of the package; rather, it's the SMS package ID. For example, if my SMS site is named ZTI, the package ID might be ZTI00007. You can view package IDs by opening the SMS Administrator Console and clicking Image Packages, as the figure at http://www.windowsitpro.com/articles/images/smsosdpackageid.gif shows.

The OSDINSTALLPROGRAM variable is the actual name of the program defined for the specified package (e.g., WindowsXPProSP2Base). Set the OSDINSTALLSILENT variable to 1 for a silent installation. The following sample script, which you can download at http://www.windowsitpro.com/articles/download/CreateOSDObject.zip sets the variables you need. In the real world, you'd probably perform some type of lookup in the script to determine the values.

  ' Create the OSD Environment Object  Dim env : set env = CreateObject("OSD.Environment")  env("OSDNEWMACHINENAME") = "Computer"  env("OSDINSTALLPACKAGE") = "ZTI00007"  env("OSDINSTALLPROGRAM") = "WindowsXPProSP2Base"  env("OSDINSTALLSILENT") = "1"  WScript.Quit(0)  

The WScript.Quit(0) line is important because it tells the OS Deployment Feature Pack that the script exited without an error condition. The SMS OS Deployment Feature Pack documentation lists all the relevant SMS OS Deployment Feature Pack environment variables.

Q. How can I use a VBScript script to read Windows Management Instrumentation (WMI) information?

A. To read WMI information, you must write code that connects to the WMI management object, then runs a query against it. Remember, WMI has multiple classes of information, so you need to query the correct class to retrieve the desired information. These classes are documented in the WMI software development kit (SDK); an online version of the SDK is available at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_classes.asp. The following sample script, which you can download at http://www.windowsitpro.com/articles/download/compquery.zip, queries a computer's model and serial number. This information is located in two separate classes, so you need to use two queries.

  Dim objWMI : Set objWMI = GetObject("winmgmts:")  Dim colSettingsComp : Set colSettings = objWMI.ExecQuery("Select * from Win32_ComputerSystem")  Dim colSettingsBios : Set colSettingsBios = objWMI.ExecQuery("Select * from Win32_BIOS")  Dim objComputer, strModel, strSerial  For Each objComputer in colSettings    strModel = objComputer.Model  Next  For Each objComputer in colSettingsBios    strSerial = objComputer.SerialNumber  Next  wscript.echo strModel  wscript.echo strSerial    


To execute the script from a command line, save the previous script as wmi.vbs, and run this query:

cscript wmi.vbs

You'll see the following on-screen messages:

  Microsoft (R) Windows Script Host Version 5.6  Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.  Latitude D800  2TVKQ51  

You can change the code to query any type of information that WMI is aware of.

Q. How can I troubleshoot custom scripts I created to use with the Microsoft Systems Management Server (SMS) OS Deployment Feature Pack?

A. The Microsoft Windows Preinstallation Environment (WinPE) 2004 instance that SMS uses or a customized WinPE instance that SMS updates doesn't have a management console that you can use for troubleshooting purposes. The entire deployment process is driven by the graphical SMS OS Deployment Feature Pack shell. For troubleshooting purposes, you can replace this shell with a "lab" version. This lab shell version lets you open a console session during the WinPE initialization process by pressing F8. While the console is open, the computer won't reboot and you can view any logs that might have been generated (normally created in the C:\minint\smsosd\osdlogs folder) to help ascertain the cause of problems.

The lab version of the shell is called osdshell.lab.exe. You simply replace the standard osdshell.exe with this lab version to enable the F8 ability to start a console session. If you're using a Microsoft Remote Installation Services (RIS)-integrated OS deployment environment, you replace the osdshell.exe file in the OS's system32 folder with the lab version. If you're using a CD-ROM-based deployment, you need to replace the osdshell.exe file in the source folder of your SMS deployment (e.g., C:\sms\osd), then update your OS package files and rebuild the CD-ROM. This process is explained in detail in the SMS OS Deployment Feature Pack documentation in the "Using the Lab Shell for Windows PE" section.

  • New NetOp Remote Control v 8.0

  • Try it Free – New NetOp Remote Control v8.0 – Faster, more secure, remote access & support, PC inventory, file transfers and scripting. New Remote Management Console and security options to help you meet today's auditing and compliancy requirements. NetOp - Nothing comes remotely close. Try it today.
    http://www.crossteccorp.com/netopremote/?utm_source=winitpro&utm_medium=email&utm_campaign=v8_45

    Events and Resources
    (A complete Web and live events directory brought to you by Windows IT Pro: http://www.windowsitpro.com/events )

  • Get Chapter 2 of "SQL Server Administration for Oracle DBAs"

  • Learn the key concepts that give Oracle DBAs a firm foundation in mapping Oracle database-management skills, knowledge, and experience to SQL Server database management. Chapter 2 of this free eBook discusses SQL Server management, including managing memory, processes, storage, sessions and transactions, and low-level structures (e.g., locks, latches). Download Chapter 2 now!
    http://www.windowsitlibrary.com/ebooks/sqlserveradminoracle/index.cfm?code=0330emailanncs

  • The Essential Guide to Active Directory Management

  • Migrating from NDS and/or eDirectory to AD means changes in the way you manage your network, users, and network resources. Download this Essential Guide to Active Directory Management and learn hands-on approaches that reduce management complexity, IT workload, and costs and improve security--all with minimal impact on your organization. Download this guide today.
    http://www.windowsitpro.com/essential/index.cfm?code=0330emailannc

  • Enabling Secure Collaboration in the Workplace

  • Join Microsoft and Sybari experts and learn how to help foster collaboration among employees and partners while reducing security risks and enforcing corporate compliance policies. Webcast attendees will be entered to win an HP iPAQ and are eligible for a 40% discount on Sybari Antigen for SharePoint software. Register Now!
    http://www.windowsitpro.com/microsoftexchangeoutlook/securemessaging

  • Attend This Free Web Seminar for a Chance to Win a $1000 American Express Gift Check!

  • Achieve High Availability and Disaster Recovery for Microsoft Servers. In this Web seminar, discover what it takes to minimize the likelihood of downtime through reliability and resilience in your Microsoft server environment, including Exchange Server, SQL Server, File Server, IIS, and SharePoint. Sign up today!
    http://www.windowsitpro.com/seminars/microsofthighavailability/index.cfm?code=0330emailannc

  • Hey Europe! Get Ready to Become the Next Gatekeeper Champion

  • Get a leg up on your fellow European IT pros by getting all the study materials you'll need to help you prepare for the next Gatekeeper competition on April 4. Windows IT Pro will help you hone your security skills and become the ultimate IT security expert. Start preparing now by visiting:
    http://emea.windowsitpro.com/emea/index.cfm?action=Gatekeeper

    Announcements
    (from Windows IT Pro and its partners)

  • Get Windows IT Pro at 44% Off!

  • Windows & .NET Magazine is now Windows IT Pro! Act now to get an entire year for just $39.95--that's 44% off the cover price! Our March issue shows you what you need to know about Windows Server 2003 SP1, how to get the best out of your IT staff, and how to fight spyware. Plus, we review the top 10 features of Mozilla Firefox 1.0. This is a limited-time, risk-free offer, so click here now:
    http://www.windowsitpro.com/rd.cfm?code=theu2052up

    Contact Us
    Here's how to reach us with your comments and questions:

    This email newsletter is brought to you by Windows IT Pro, the leading publication for IT professionals deploying Windows and related technologies. Subscribe today.
    http://www.windowsitpro.com/rd.cfm?code=00eu205xeb