Microsoft Windows Deployment Image Servicing and Management (DISM) Show
Microsoft Windows Deployment Image Servicing and Management (DISM) is a software tool that information technology (IT) administrators can access through the command line or PowerShell to mount and service a Windows desktop image or hard disk before deploying it to users. The command line for Deployment Image Servicing and Management (DISM) is DISM.exe. DISM also provides IT administrators with information about the image files and hard disks. The Windows image can come from a Windows Imaging Format file (.wim), a virtual hard disk file or a Hyper-V virtual hard disk file, as well as a running operating system. IT administrators can capture, manage or split .wim files and use DISM to install or uninstall all three file types. Administrators can alter or update Windows features, packages, drivers and international settings with DISM, but DISM does not allow administrators to install packages on remote computers. In addition, DISM does not support multiple unattend files or multiple servicing commands. Starting with Windows 8, DISM comes with the Windows operating system and is distributed as part of the Windows Assessment and Deployment Kit (ADK). It works on 32-bit and 64-bit versions of Windows 7 and above and Windows Server 2008 Service Pack 2 and above. DISM is also compatible with the Windows Recovery Environment and Windows Preinstallation Environment. DISM does work with older image files, but the image cannot be more recent than the version of ADK that IT uses to distribute DISM. It is most common for IT administrators to use DISM on offline images, but certain subsets of the DISM command allow them to use it while the operating system is running. IT shops can use DISM in place of other image deployment tools, such as PEImg, Intlcfg, ImageX and Package Manager. In this chapter from Exam Ref 70-688: Supporting Windows 8.1, you’ll learn how to support various operating system installations that are, for the most part, already in place, ranging from the most basic Windows 8.1 installations to native virtual hard disks to specialty Windows installations unique to a single enterprise. You’ll learn how to support desktop apps in many ways, too, including how to run those apps in virtual, cloud, or remote environments when running them on each workstation isn’t ideal. Finally, you’ll learn how network administrators can make their own apps available to users in a process called sideloading. You must pass two exams to earn the Microsoft Certified Solutions Associate (MCSA) certification. The first, Configuring Windows 8.1 (70-687), deals mainly with how to install and configure the operating system. The second, Supporting Windows 8.1 (70-688), deals mainly with how to support those installations and configurations for the long term. Because the common factor between these two exams is Windows 8.1, you’ll see some overlap. For instance, you learn how to install Windows To Go while preparing for Exam 70-687, and you learn how to support Windows To Go while preparing for Exam 70-688. That’s a fine line; make sure that as you work through this book you understand that installations and configurations might already have been performed, and that those who write the exam questions might simply assume that you know how to do it. That said, you will still see how to perform some installation and configuration tasks in this chapter, especially those you might not be familiar with. In this chapter you’ll learn how to support various operating system installations that are, for the most part, already in place, ranging from the most basic Windows 8.1 installations to native virtual hard disks to specialty Windows installations unique to a single enterprise. You’ll learn how to support desktop apps in many ways, too, including how to run those apps in virtual, cloud, or remote environments when running them on each workstation isn’t ideal. Finally, you’ll learn how network administrators can make their own apps available to users in a process called sideloading. Objectives in this chapter:
Objective 1.1: Support operating system installationYou can install an operating system in many ways beyond the familiar upgrade-with-a-DVD or boot-to-a-DVD method. You can install Windows 8.1 as Windows To Go, native virtual hard disk (VHD), and as part of a multiboot system, for example. You also can customize an installation. As an enterprise network administrator, you can configure a reference computer exactly as you want it, install drivers, software, specialty screen savers, and so on, and then create an image of that computer to use for workstation installations. You can also perform installations via a network by enabling the computers to locate the installation files on a network server. Installations can be lite-touch and zero-touch, too, and include unique answer files to reduce the amount of human contact required during the installation process. In this objective you’ll learn how to support many of these types of installations. Supporting Windows To GoTo create a Windows To Go workspace, you must have access to a Windows 8-based Enterprise edition computer. Windows 8.1 Enterprise has a Windows To Go Creator Wizard just for that purpose. You create and save the workspace to a certified Windows To Go USB flash drive. After it’s created, you give authorized users the configured flash drive, which they can use to run Windows from a computer other than their own, assuming that the computer can be configured to start to a USB drive and run a compatible operating system. A few things are unique about Windows To Go:
Hosting Windows To GoThe host computer is the computer used to start to the Windows To Go USB drive. The host computer must:
TABLE 1-1 Computer requirements when hosting Windows To GoItem Requirement Startup and firmware The computer must be able to start to a USB drive and firmware must be USB enabled. Processor architecture The architecture must support the image on the Windows To Go drive (see Table 1-2). USB port The host must have an available USB port that can’t be part of a USB hub and must be 2.0 or later. Processor, RAM, graphics The host must meet minimum standards for Windows 8, including a 1-GHz processor or higher, 2 GB of RAM or higher, and a DirectX 9 graphics device with WDDM 1.2 or greater driver. TABLE 1-2 Architecture requirements for hosting Windows To GoFirmware/Processor Compatible architecture Legacy 32-bit BIOS 32-bit Legacy 64-bit BIOS 32-bit and 64-bit UEFI 32-bit BIOS 32-bit UEFI 64-bit BIOS 64-bit Note also that the host computer’s internal hard disks aren’t accessible. This is to ensure that data isn’t accidentally or maliciously accessed by the temporary user. Likewise, Windows To Go won’t be listed in File Explorer. Starting to Windows To GoIf a host meets the requirements for starting to a Windows To Go USB drive, you should change the startup options on the host to ensure that it will do exactly that when a USB Windows To Go drive is inserted. To change the Windows To Go startup options on a host running Windows 8.1, follow these steps:
When you’re ready, turn off the host computer, insert the Windows To Go USB drive into an applicable USB port, and restart the computer. During this first restart, the host scans for the Windows To Go drive and installs any required drivers. The information is cached so that next time the process won’t be repeated. When the Windows To Go workspace opens, you use it as you would any Windows 8.1 installation, but understand the limitations detailed earlier (such as Hibernate being disabled and internal drives unavailable). Configuring Group Policy for Windows To GoAdministrators configure and apply Group Policy to control what workers, guests, user groups, and even computer groups can do or access, either locally or on a domain. For example, you might use Group Policy to keep users from accessing the Windows Store or from copying data to removable drives. You might also require that all computers on a company network use a specific desktop background. Group Policy helps you maintain a secure (and sometimes identical) work environment for everyone. This makes managing large networks easier. On domains, you configure Group Policy by using the Group Policy Management Console (gpmc.msc) or the Group Policy Editor (gpedit.msc). On a workgroup, you use the Local Group Policy Editor on each computer. Three Windows To Go settings are available:
To locate and explore the available Windows To Go Local Group Policy settings, and to enable Windows To Go Default Startup Options, follow these steps:
Managing boot settingsStartup settings determine how a computer starts by default. When multiple operating systems are available, a list of startup entries generally appears from which users can choose what they want. BCDedit and BCDboot are command-line utilities used to configure and control the process. Startup configuration parameters are stored in the Boot Configuration Data (BCD) Store, which you manage with the BCD Editor (Bcdedit.exe). Although these command-line tools might be new to you, you might already be familiar with a related end-user option available from the System tool in Control Panel. Click Advanced System Settings to see the dialog box shown in Figure 1-3 on the left, and click Settings under Startup and Recovery to see the Startup And Recovery dialog box shown on the right. The Startup And Recovery dialog box in Figure 1-3 also shows that Windows 8.1 is the default operating system. If multiple operating systems exist on the machine, the list of startup options remains on the screen (and available for selection) for 30 seconds before the default operating system automatically starts. When you need to make simple changes (such as changing the default operating system), you can make those changes in the Startup And Recovery dialog box. FIGURE 1-3 Change basic startup settings from the Startup And Recovery dialog box. You can also change how Windows starts by using the System Configuration utility (Msconfig.exe) and the BCD Windows Management Instrumentation (WMI) provider. The System Configuration utility is more advanced than the Startup And Recovery dialog box and offers more tools with capabilities that include /debug, /safeboot, /bootlog, /noguiboot, /basevideo, and /numproc. The latter is a management interface that you can use to script utilities that modify BCD. Using BCDeditBcdedit.exe is a command-line utility that replaced Bootcfg.exe in Windows Vista. Figure 1-4 shows this command and the resulting information regarding the BCD Store on a computer running only Windows 8.1 Enterprise. Notice the Administrator command prompt. The results show two entries: Windows Boot Manager and Windows Boot Loader. FIGURE 1-4 Type bcdedit at an Administrator command prompt to view the BCD Store. Windows Boot Manager lets you to choose which startup application to run and controls that process during startup. One of those applications is the Windows Boot Loader, which loads Windows—in this case, Windows 8.1 Enterprise. You can do much more with the bcdedit command than simply showing the BCD Store information. You can do the following, for example:
You’ll likely be tested on the various parameters you can use with the bcdedit command. Here are some with which you should be familiar (you can find a more complete list at http://technet.microsoft.com/en-us/library/cc709667(v=WS.10).aspx):
Using BCDbootInstalling Windows 8.1 or any other operating system on a hard disk automatically creates partitions. The system partition contains the files required to start the operating system (as well as the Boot folder) that tells the computer where the operating system is stored. The boot partition contains the Windows operating system files. The active partition, a system partition, is the one used to start Windows. You can have multiple startup partitions—and you will if you have a multiboot system. BCDboot helps you manage these partitions. Bcdboot.exe (as well as Bcdedit.exe) is located in the Windows\System32 folder of a Windows 8.1 computer. You can copy startup files from the Windows directory with this command: x:\Windows\System32\bcdboot x:\Windows You can use the bcdboot command to do the following, for example:
You can view the parameters listed here by typing bcdboot /Windows at an Administrator command prompt, as shown in Figure 1-5. FIGURE 1-5 Type bcdboot /windows to view available parameters for the command. You should be familiar with these bcdboot parameters:
You can view the current partitions for any Windows 8.1 computer in Disk Management, as shown in Figure 1-6. Adding a native VHD to the startup menuA virtual hard disk (VHD) is a single file that functions as a unique, separate drive with its own operating system. If you studied for Exam 70-687, Configuring Windows 8.1, you learned how to create a VHD inside an existing operating system by using the Disk Management console, and then how to install Windows on it by using tools in the Windows Assessment and Deployment Toolkit (ADK). You learned how to attach the VHD and then run it “on top of” your Windows 8.1 default installation in its own separate window and space. In this instance, the VHD had a parent operating system. VHDs can also run on their own, without the need for a parent operating system. These are called native VHDs. You can create a native VHD and use it to start by using the computer’s actual hardware. This is easier to do if the computer already has an operating system on it, but it’s not required that it does. In fact, you can run this kind of VHD on a computer with no existing virtual machine or hypervisor. Adding a native VHD to a computer with an operating systemIf the computer has an operating system, you can create and attach a VHD by using the Disk Management console. From the Action menu select Create VHD to get started. Then use the Action menu again to attach the newly created VHD. (Creating a VHD was covered in Exam Ref 70-687: Configuring Windows 8.1.) With the VHD created and attached, you can now work through the following general steps:
Adding a native VHD to a computer without an operating systemIf a computer doesn’t have an operating system, you need some way to communicate with it and make the desired configurations—in this case, adding a native VHD to the startup menu. You do this by creating and using a Windows Preinstallation Environment (Window PE) 8.1 disk and a Windows Image (.wim) file. To get started, you need to install the Windows ADK on another Windows 7 or Windows 8-based technician computer. Use the Windows ADK to create the Windows PE disk. You use this disk and various tools to apply the .wim you want to install. You use the Deployment Image Service and Management (DISM) tool to apply an existing Windows 8 image, perhaps one you created for your enterprise (or to modify the image). This image can include drivers, for example. Assuming that the computer doesn’t have an operating system on it and has at least 30 GB of free disk space, you first must use the DiskPart tool to create, attach, partition, and format a new virtual hard disk. At a command prompt, type the following, noting that you can generally use different parameters than what you see here for size, type, drive letter, and so on as desired: Diskpart create vdisk file=C:\windows.vhdx maximum=25600 type=fixed select vdisk file=C:\windows.vhdx attach vdisk create partition primary assign letter=v format quick label=vhdx exit To apply the desired Windows image and to use the DiskPart tool to detach the virtual disk after applying it, type Dism /apply-image /imagefile:install.wim /index:1 /ApplyDir:V:diskpart select vdisk file=C:\windows.vhdx detach vdisk exit To copy the VHDX file to a network share or USB hard drive, if applicable, type net use n: \\server\sharemd N:\VHDXs copy C:\windows.vhdx n:\VHDs\ Start the destination computer with the Windows PE disk, and then format the hard disk and create a system and primary partition. Type Diskpart select disk 0 clean create partition primary size=350 select partition 1 format fs=ntfs label=”System” quick active create partition primary format fs=ntfs label=”Windows” quick assign letter=c exit Copy the VHDX file and attach it on the destination computer by typing the following: copy N:\VHDs\Windows.vhdx C diskpart select vdisk file=C:\windows.vhdx attach vdisk Note the letter given to the VHD in the volume list. To exit the DiskPart tool, type list volume select volume assign letter=v exit Copy the boot-environment files from the \Windows directory in the VHD to the system partition. The BCDboot tool creates the BCD configuration required to start from the VHD. Type cd v:\windows\system32 bcdboot v:\windows Use the DiskPart tool to detach the virtual disk and then restart the destination computer. Type Diskpart select vdisk file=C:\windows.vhdx detach vdisk exit On restart, the Boot Manager starts via the .vhdx file. Working with multiboot systemsA multiboot system has two or more operating systems installed on it. In a multiboot configuration, each operating system uses its own unique partition, and the operating systems are completely independent of one another. Most network administrators use (or formerly used) multiboot systems to test new operating systems and to determine compatibility with existing software and hardware. Most end users choose this type of setup when they need to run a legacy application that isn’t compatible with Windows 8.1 and can’t be forced into compatibility with Program Compatibility Mode. (Most users don’t understand, have never heard of, or can’t configure a VHD to resolve these kinds of problems.) Creating a multiboot system is easier than you might think, assuming that your computer has a large enough hard drive to create a new partition for a second operating system. Only a few steps are involved: Shrink an existing partition so that you can use the new, unused space to create a second partition; create the new partition; and then install the operating system on it. You use Disk Management to shrink a partition:
You should see the new partition in the Disk Management window. You can now insert a bootable DVD that contains the operating system you want to install. Restart the computer, start to the DVD, and during the installation process select Custom to select the new partition. Windows installs the second operating system onto that partition. After the installation is complete, you should see the new operating system as an option at startup. Remember, you can change the defaults from the Startup And Recovery dialog box detailed earlier in this chapter. Managing desktop imagesNetwork administrators can opt to use a standard Windows Image (.wim) file to perform installations on their enterprise workstations. The standard image is the out-of-the-box installation file you receive when you purchase a Windows 8.1 DVD. When taking this route, you must then, using some method, also install the desired Office applications, device drivers, and so on, and configure each computer so that it meets company standards. Because this is quite time-consuming, enterprise administrators often opt to create a custom Windows image that contains all these things and more, so that fewer after-the-installation tasks need to be completed. Beyond building your own images, you must also design and implement a way to move existing user data from the old machine to the new or, if the installation is performed on a single PC, to move it off and then back on when the installation is complete. You can do this in several ways, including by using Windows Easy Transfer for small migrations or the User State Migration Tool (USMT) for large ones. If neither fits the scenario, you can opt to manually move data off the PC and then back on. Beyond even that, installations of images (and the folders that hold them) might also include custom answer files to limit the interaction required during the installation process. Knowing what you’ll see on the exam is difficult with regard to managing desktop images, because the area of study is extensive. You might need to know how to create or deploy a custom image, or only how to modify an existing image. You might be required to know how to include options to migrate user data during image deployment, or you might not. The goal of the next few pages is to introduce you to many of the facets of desktop imaging, but because everything can’t be covered, links are provided where you can learn more. Understanding desktop imagesAn image is an installation file. An image can be customized so that it is unique to the company and meets the company’s specific needs. In larger enterprises, administrators likely create multiple desktop images. One image might be for the Sales team’s laptop computers, another for the desktop computers in the Human Resources department, and another for the tablets used by high-ranking administrators. These images can be used for more than just installations, though. When a computer needs to be reimaged—perhaps when a user leaves the company or a computer becomes unstable—you can use the desired image to reinstall the computer quickly. By using data stored on network servers, you can quickly transfer user data also. Desktop images can also be serviced rather than rebuilt if an image itself becomes corrupt. Images can contain device drivers, applications, specific settings for the desktop background, and so on. A thin image has little or no customization, and most of the device drivers, applications, and updates are installed by using another method on each client computer. A thick image includes applications, device drivers, and updates (for example) and requires much more planning, network bandwidth, and other resources than thin images. A hybrid image is lightly customized. It might be used as a base image for an entire organization’s desktop computers. Thin images are recommended in most instances because they can reduce installation time, maintenance time, storage requirements, and costs, for example. The Microsoft Deployment Toolkit (MDT) makes using thin images with the Lite-Touch, High-Volume Deployment strategy pretty straightforward for experienced network administrators. For more information, visit http://technet.microsoft.com/en-us/windows/dn282138. Creating a desktop imageTo create an image, you need the MDT, the Windows ADK, and a file server to hold the installation files (as a share). When you’re ready to deploy that image, you need media that you can use to start the computers during deployment or a server configured with the Windows Deployment Services (WDS) role, and network cards on the PCs to upgrade that can start to the installation image. If you have all this in place, you should create an image and deploy it as Lite-Touch, High-Volume Deployment if your enterprise has between 200 and 500 computers, or use a Zero-Touch, High-Volume Deployment if your enterprise has 500 or more machines. Many steps are involved in creating a custom installation, and a high-level outline is provided here:
Modifying or repairing a desktop imageIf you create an image and then need to modify it, you can use the DISM command-line tool, available from the Windows ADK. You learned a little about this tool earlier in the chapter when you saw how to add a native VHD to a computer without an operating system. There, you used it to mount the installation file. You should know some more facts about DISM:
Use the commands in Table 1-3 to repair an image. TABLE 1-3 Commands for repairing an imageAction Command To check for corruption Dism /Online /Cleanup-Image /ScanHealth To check whether corruption has been detected Dism /Online /Cleanup-Image /CheckHealth To repair an offline image by using a mounted image as a repair source Dism /Image:C:\offline /Cleanup-Image /RestoreHealth /Source:c:\test\mount\windows To repair an image by using your own sources without involving Windows Update Dism /Online /Cleanup-Image /RestoreHealth /Source:c:\test\mount\windows /LimitAccess To modify an image, you need to know quite a bit more about DISM. You can find command sets that enable you to do the following:
This isn’t a complete list, of course. Each modification requires that you type a set of commands. For example, to add or remove a language pack, assuming that your image is already mounted (this is the easiest to achieve), you would follow this sequence:
The Windows image is now ready to be deployed. Using Windows Easy Transfer and the User State Migration ToolYou can use the Windows Easy Transfer (WET) Wizard to migrate user data (such as profile information) off a computer to complete a clean installation on it. After the installation is complete, you can migrate the data back. You also can use WET to move data from one computer to another. You would use this method to migrate data only for a small number of computers; you wouldn’t want to use it in an enterprise. You can use the scriptable command-line User State Migration Tool (USMT) to migrate user data from a previous edition of Windows to Windows 8.1. By using USMT, you can copy the user data you select, exclude any data that doesn’t need to be migrated, and then transfer the selected data back to the computer after it’s installed clean with Windows 8.1. You can also transfer the data to a brand new or newly installed Windows 8.1 computer. USMT provides much of the same functionality as Windows Easy Transfer. However, although USMT has the same basic capabilities as WET, USMT is a command-line tool and WET is graphical. This isn’t a disadvantage in a large organization, because administrators can use USMT to incorporate USMT tasks into scripts, which are better suited for domains, enterprises, and automated deployments. (Scripts, task sequences, answer files, and so on are what help automate a deployment.) Two tools included with USMT are ScanState and LoadState, both command-line tools. When you use USMT, you’ll also use Windows PE, which you learn about next. Customizing a Windows installation by using Windows Preinstallation Environment (Windows PE)When you create a custom installation, you also create a Windows PE disk. It’s unique to your image. You can use the Windows PE disk to start the installation process on a client computer. Before focusing more on this, though, you should look at what Windows PE actually is. Exploring Windows PEThe startup process has changed over the years. When Windows ME was retired, so was MS-DOS. Windows 8, Windows 7, and Windows Vista no longer rely on MS-DOS for any part of the installation and startup process. To replace MS-DOS, Windows uses Windows PE, a minimal operating system that you can use to prepare a computer for a Windows installation. Windows PE can start a computer that has no operating system or has other problems. When deploying Windows 8.1, you can use Windows PE to partition and format hard drives, copy disk images to a computer, and initiate Windows Setup from a network share. You can create a Windows PE disk by using the tools in the Windows ADK. With regard to USMT, you use a customized Windows PE startup disk to start the source computer (the computer that holds the files to migrate) and use the tools available on the disk to collect the data you want to migrate. Windows PE offers the following improvements and advantages over MS-DOS. As you read through this list, think about how important each item is to automated and custom operating system deployments:
Windows PE has various restrictions, not limited to the following:
Copying the Windows PE files and creating a standard Windows PE DVD diskYou need to copy the Windows PE files to your computer before you can work with them or create a custom Windows PE disk. You can copy and create 32-bit or 64-bit sets, or both, using the Copype command as detailed in the following steps. You can also create an ISO file if you want to create a standard, bootable Windows PE DVD. You must complete steps 1–3 before you can continue with the next section. To create a standard, bootable Windows PE DVD disk, follow these steps:
Mounting and modifying Windows PEYou can customize Windows PE to meet your own needs. A more common customization is to add device drivers, but you can also add languages, add an app, replace the background image, add answer file settings, add a startup script, and more. Before you continue here, however, make sure that you’ve installed the required Windows ADK tools and worked through steps 1–3 in the preceding section to install the Windows ADK and copy the appropriate Windows PE files to your hard drive. As an example of what you can do, you can follow these steps to mount and modify a Windows PE image specifically to change the desktop background:
Before you can customize Windows PE by replacing the background image, you must first change the security permissions of the background image file so that you can modify it. The default image file is at \windows\system32\winpe.jpg. Follow these steps to make the required modifications:
To learn how to perform other customizations, you can refer to the steps at http://technet.microsoft.com/en-us/library/hh824972.aspx. You’ll find the commands you need to modify other areas of Windows PE. For example, to add device drivers to the Windows PE image, use these commands at the DISM Administrator prompt:
To add an app, use these commands:
Objective summary
Objective reviewAnswer the following questions to test your knowledge of the information in this objective. You can find the answers to these questions and explanations of why each answer choice is correct or incorrect in the “Answers” section at the end of this chapter.
|