Partager via


How to Create Stand-Alone Operating System 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 stand-alone operating system media for use with operating system deployment by using the TsMediaClass Client COM Automation ClassITsMediaClass::CreateStandaloneMedia Method method.

There are a number of TSMedia class properties that you have to populate before calling CreateStandaloneMedia:

Property Description

ProviderName

The SMS Provider computer name.

SiteCode

The Configuration Manager 2007 site code.

DistributionPoints

A comma-delimited list of distribution point computer names.

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. For more information, see ITsMediaClass::CreateStandaloneMedia Method.

CreateStandaloneMedia has the following parameters:

Parameter Description

MediaType

Specifies the type of media that is created. This can be ISO, WIM, UFD and UFD + Format. For more information, see ITsMediaClass::CreateStandaloneMedia Method..

DestinationPath

The path and file name for the created image.

MediaSize

The size of the media to be created, in megabytes.

MediaPassword

The media password.

TaskSequenceId

The task sequence identifier. This can be obtained from task sequence SMS_TaskSequencePackage object PackageID property.

TaskSequenceVariables

Zero or more task sequence variables in the format "name1=value1,name2=value2".

Async

Specifies if the call to CreateStandaloneMedia is performed synchronously (false) or asynchronously (true). This parameter is optional, and if it is omitted, the call is synchronous.

To create stand-alone media

  1. Create an instance of the TSMedia object.

  2. Populate the ProviderName, SiteCode, DistributionPoints, ConnectionOptions and MediaLabel properties.

  3. Call the CreateStandaloneMedia method to create the ISO file.

Example

The following example asynchronously creates a CD ISO file using the supplied parameters.

For information about calling the sample code, see How to Call Configuration Manager COM Automation Objects.

Sub CreateStandaloneMedia(providerName, _
        siteCode,           _
        distributionPoints, _
        connectionOptions,  _
        mediaLabel,         _
        mediaType,          _
        destinationPath,    _
        mediaSize,          _
        mediaPassword,      _
        taskSequenceId,     _
        taskSequenceVariables )

    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.CreateStandaloneMedia( mediaType, _
            destinationPath,        _
            mediaSize,              _
            mediaPassword,          _
            taskSequenceId,         _
            taskSequenceVariables,  _
            true)
    
    While tsmedia.Status = 0
          WScript.Echo tsmedia.CurrentStep & "/" & tsmedia.NumSteps & _
          "  (" & tsmedia.StepProgress & ")  " & tsmedia.StepInfo
          WScript.sleep 1000
    Wend
    WScript.Echo "Standalone 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 computer names.

connectionOptions

VBScript: string

A comma-delimited list of name value pairs that is used when establishing the WMI connection to the provider. The possible values are documented in ITsMediaClass::ConnectionOptions Property.

mediaLabel

VBScript: string

The label for the media.

mediaType

VBScript: string

The media type.

destinationPath

VBScript: string

The path and file name for the created image.

mediaSize

VBScript: integer

The size of the media to be created, in megabytes.

mediaPassword

VBScript: string

The media password

taskSequenceId

VBScript: string

The task sequence identifier. This can be obtained from task sequence SMS_TaskSequencePackage object PackageID property.

taskSequenceVariables

VBScript: string

Zero or more task sequence variables in the format "name1=value1,name2=value2".

See Also

Concepts

About Operating System Deployment Media Management
How to Create Capture Media
How to Create Boot Media
How to Serialize a Certificate from a PFX File
How to Create and Serialize a New Self-Signed Certificate
Operating System Deployment Task Sequencing