How to Create Boot Media
Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2
In Microsoft System Center Configuration Manager 2007, you create boot media for use with operating system deployment by using the TsMediaClass Client COM Automation ClassITsMediaClass::CreateBootMedia Method method.
There are a number of TSMedia objects that you have to populate before calling CreateCaptureMedia:
Property | Description |
---|---|
ProviderName |
The SMS Provider computer name. |
SiteCode |
The Configuration Manager 2007 site code. |
DistributionPoints |
A comma-delimited list of distribution point computers. |
ConnectionOptions |
A comma-delimited list of name value pairs that is used when establishing the Windows Management Instrumentation (WMI) connection to the provider. The possible values are documented in ITsMediaClass::ConnectionOptions Property. |
MediaLabel |
The label for the media. |
CreateBootMedia has the following parameters that you supply.
Parameter | Description |
---|---|
MediaType |
Specifies the type of media that is created. This can be ISO, WIM, UFD and UFD + Format. For more information, see CreateBootMedia. |
DestinationPath |
The path and file name for the created image. |
BootImageID |
Identifies the boot image that the image is created for. You can obtain this value from the boot image's SMS_BootImagePackage object PackageID property. |
MediaPassword |
The media password. |
CertPath |
Specifies whether the call to CreateBootMedia is performed synchronously (false) or asynchronously (true). This parameter is optional, and if it is omitted, the call is synchronous. |
CertPassword |
Null-terminated string specifying a password for the media certificate. |
CertValidStart |
If a new certificate is created, the time when it starts being valid. |
CertValidEnd |
If a new certificate is created, the time when it stops being valid. |
Async |
Specifies whether the call to CreateBootMedia is performed synchronously (false) or asynchronously (true). This parameter is optional, and if it is omitted, the call is synchronous. |
To create boot media
Create an instance of the TSMedia object
Populate the ProviderName, SiteCode, DistributionPoints, ConnectionOptions and MediaLabel properties
Call the CreateBootMedia method to create the ISO file.
Example
The following example asynchronously creates a CD ISO file.
For information about calling the sample code, see How to Call Configuration Manager COM Automation Objects.
Sub CreateBootMedia (providerName, _
siteCode, _
distributionPoints, _
connectionOptions, _
mediaLabel, _
mediaType, _
destinationPath, _
bootImageID, _
mediaPassword)
Dim tsmedia
Dim hr
Set tsmedia = CreateObject("Microsoft.ConfigMgr.TsMedia")
' Change these properties according to your configuration.
tsmedia.ProviderName = providerName
tsmedia.SiteCode = siteCode
tsmedia.DistributionPoints = distributionPoints
tsmedia.ConnectionOptions = connectionOptions
tsmedia.MediaLabel = mediaLabel
hr = tsmedia.CreateBootMedia( mediaType, _
destinationPath, _
bootImageID, _
mediaPassword, _
NULL, _
NULL, _
now, _
now+30, _
true)
While tsmedia.Status = 0
WScript.Echo tsmedia.CurrentStep & "/" & tsmedia.NumSteps & _
" (" & tsmedia.StepProgress & ") " & tsmedia.StepInfo
WScript.Sleep 1000
Wend
WScript.Echo "Boot media creation finished with result = " & tsmedia.ExitCode
End Sub
Important
No C# example was included due to a known issue with TsMediaClass Client COM Automation Class.
The example method has the following parameters:
Parameter | Type | Description |
---|---|---|
providerName |
VBScript: string |
The SMS Provider computer name. |
siteCode |
VBScript: string |
The Configuration Manager 2007 site code. |
distributionPoints |
VBScript: string |
A comma-delimited list of distribution point computers. |
connectionOptions |
VBScript: string |
A comma-delimited list of name value pairs that is used when establishing the WMI connection to the provider. |
mediaLabel |
VBScript: string |
The label for the media. |
mediaType |
VBScript: string |
Specifies the type of media that is created. This can be ISO, WIM, UFD and UFD + Format. |
destinationPath |
VBScript: string |
The path and file name for the created image. |
bootImageID |
VBScript: string |
The boot image identifier. You can obtain this value from the boot image's SMS_BootImagePackage Server WMI ClassPackageID property |
mediaPassword |
VBScript: string |
The media password. |
Robust Programming
For more information about error handling, see About Configuration Manager Errors.
Security
For more information about securing Configuration Manager applications, see About Securing Configuration Manager Applications.
See Also
Concepts
About Operating System Deployment Media Management
How to Create Capture Media
How to Create Stand-Alone Operating System Media
How to Serialize a Certificate from a PFX File
How to Create and Serialize a New Self-Signed Certificate