* Creating the OS Deployment Package
* Creating the OS Deployment Program
* Configuring the Program Properties
* Creating the Distribution Point
Creating the OS Deployment Package
*
Open SMS Administrator Console. Expand Site Database and select Image Packages. Right click on Image Packages node, point to New and click on Operating System Image Package.

* Click Next on the Welcome page of New Operating System Package Wizard.
* Type a descriptive name for the package you are creating. Enter the path to the OS image file captured in the Part-1 of this post. Enter the UNC path to the packages folder. Click Next on the Operating System Package Settings page.
Note: Packages folder to be entered in Package Source frame will be used to store the package files. Create a Packages folder on SMS server to store OS packages and share it. Give the full permission to SMSAdmin (SMS service account). Also, always create a subfolder for each OS package you are creating.

* Click Finish to create the OS package.
Creating the OS Deployment Program
*
Expand the OS package, Right click on Programs, point to New and click on operating System program.

* Click Next on the Welcome page of New Operating System Program Wizard.
*
Select Create a new Operating System Program with default settings (default) and enter a Name for the OS program. Click Next on the New Operating System Program Options page.

* On the Licensing Settings page enter the product key of the operating system you are deploying, leave all other options as default and click Next. In case of deploying multiple computers at the same time you have to enter the Volume License key for the Operating system.
* Enter the domain name to join and click on the set to enter the Account and Password that has credentials to join a computer to domain. Use full DNS name of the domain to avoid name resolution problems during OS deployment. Uncheck the Create random password for the local administrator on the target computer. Click Next on Membership Settings page.
Note: Domain join can fail during OS deployment if you will use Domain NetBIOS name instead of DNS name. Also, uncheck the Create random password option because in case the domain join failed, you will not able to login to computer system. If you do not want the client systems to join domain you can enter the Workgroup name.

* On the New Operating System Program Wizard Complete page click finish to create the program.
Configuring the Program Properties
In this section of this post we will configure the program properties to achieve the different requirements during OS deployment like multiple partitions, installing security patches during OS deployment etc. We will be using different phases of OS installation to achieve multiple partitioning and deployment of security patches.
*
Right click on the OS deployment program and go to properties. Click on the Network tab. Type or browse to the LDAP path of the OU where you want your client systems accounts to be stored. Configure this program property even if you don’t want to do the customization like multiple partitions etc.

* Click on the Advanced tab and select Preinstall under the Phase frame. We will use the DiskPart tool in preinstall phase of program to create multiple partitions.
* Click on Add after selecting the preinstall phase, select custom from the actions that can be added to this phase and click OK.

*
Enter a descriptive Name for the custom action, enter the Command line and add any supported files to perform the action and click OK.
Note: Diskpart used in the above program action is a resource kit utility provided for advanced disk management. You can download it from Microsoft’s web site. DiskCommand.cmd is a batch file created to run the Diskpart and to use diskpart.ini as a help file to pass the parameters required to run Diskpart. Refer to the screenshots below for the contents of a sample DiskPart.cmd and diskpart.ini. The sample files will result in creation of two partitions. One primary partition (C: drive) of 10 GB and remaining space in the hard drive will become the logical drive (D: drive).


* On the Advanced tab, select State Restore under the Phase frame. We will use this phase to install security patches for Windows XP Service Pack 2 and Office 2003.
* Click on Add after selecting the State Restore phase, select Connect to UNC Path from the actions that can be added to this phase and click OK.
*
Enter a Descriptive Name for the action and UNC path where XP SP2 patches are stored. Click on Set button under Select the credentials to use to connect to the UNC path. Type the Account name and Password that has access to network location and click OK on the Set Account dialog box.

* Click OK to close the Connect to UNC path dialog box. Use the same steps to add the UNC path for Office 2003 patches.
* Again click Add on the State Restore phase, select custom from the actions that can be added to this phase and click OK.
*
On the Custom Action dialog box, enter a Name and Command line for the action and click on Add. In the Open dialog box, select to add the required files and click on Open.

Note: Patches.cmd used in above section is a batch file created for installing security patches from remote location. Refer to the screenshot below for the contents of sample patches.cmd file.

* Click OK to close the Custom Action dialog box and click OK again to close the program properties.
Creating the Distribution Point
* Expand the New package, right click on Distribution Points folder, point to New and click on Distribution Points.
* Click Next on the Welcome to the New Distribution Points Wizard page.
* On the Copy Package page, select the Distribution points where you want to send the package and click Finish.
* Wait for the Distribution points to be updated. To check the state of the package expand the System Status folder in Site Database hierarchy, expand Package Status folder and select the package.
* Once the distribution points are updated, package is ready to deploy.
You can create a bootable CD that references the images that are available on a distribution point to deploy and use that to manually install an image on a computer, or you can distribute the SMS OS package via Remote Installation Services (RIS). Part-3 of this post describes the steps to deploy OS Deployment package using RIS.