New-​CM​Prestaged​Media

Creates prestaged media.

Syntax

New-CMPrestagedMedia
   [-AllowUacPrompt]
   [-AllowUnattended]
   [-AllowUnknownMachine]
   [-Application <IResultObject[]>]
   -BootImage <IResultObject>
   [-CertificateExpireTime <DateTime>]
   [-CertificatePassword <SecureString>]
   [-CertificatePath <String>]
   [-CertificateStartTime <DateTime>]
   [-Comment <String>]
   [-Confirm]
   [-CreatedBy <String>]
   [-DisableWildcardHandling]
   -DistributionPoint <IResultObject[]>
   [-DriverPackage <IResultObject[]>]
   [-Force]
   [-ForceWildcardHandling]
   -ManagementPoint <IResultObject[]>
   -MediaMode <MediaMode>
   -OperatingSystemImage <IResultObject>
   [-OperatingSystemImageIndex <Int32>]
   [-Package <IResultObject[]>]
   -Path <String>
   [-PrestartCommand <String>]
   [-PrestartPackage <IResultObject>]
   [-UserDeviceAffinity <UserDeviceAffinityType>]
   [-Variable <Hashtable>]
   [-Version <String>]
   [-WhatIf]
   [<CommonParameters>]

Description

The New-CMPrestagedMedia cmdlet creates a file to prestage on a new hard drive that includes an operating system image.

Examples

Example 1: Create prestaged media

PS C:\> $ManagementPoint = Get-CMManagementPoint -SiteSystemServerName "dist01.contoso.com" -SiteCode "CM1"
PS C:\> $BootImage = Get-CMBootImage -Name "BootImage01"
PS C:\> $DistributionPoint = Get-CMDistributionPoint -SiteSystemServerName "dist01.contoso.com" -SiteCode "CM1"
PS C:\> $OSImage = Get-CMOperatingSystemImage -Name "OSImagePkg01"
PS C:\> New-CMPrestagedMedia -MediaMode Dynamic -Path "\\server\share\PrestargedMedia.wim" -BootImage $BootImage -DistributionPoint $DistributionPoint -ManagementPoint $ManagementPoint -OperatingSystemImage $OSImage

The first command gets the management point object for the site system server named dist01.contoso.com with the site code CM1 and stores the object in the $ManagementPoint variable.

The second command gets the boot image object named BootImage01 and stores the object in the $BootImage variable.

The third command gets the Distribution point object for the site system server named dist01.contoso.com with the site code CM1 and stores the object in the $DistributionPoint variable.

The fourth command gets the operating system image object named OSImagePkg01 and stores the object inthe $OSImage variable.

The last command creates a dynamic prestaged media file named PrestargedMedia.wim with the boot image stored in $BootImage, the distribution point stored in $DistributionPoint, the management point stored in $ManagementPoint, and the operating system image stored in $OSImage.

Required Parameters

-BootImage

Specifies the boot image object associated with the task sequence media. To obtain a boot image object, use the Get-CMBootImage cmdlet.

Type:IResultObject
Aliases:BootImagePackage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DistributionPoint

Specifies a distribution point object. To obtain a distribution point object, use the Get-CMDistributionPoint cmdlet.

Type:IResultObject[]
Aliases:DistributionPoints
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ManagementPoint

Specifies an array of management point objects. To obtain a management point object, use the Get-CMManagementPoint cmdlet.

Type:IResultObject[]
Aliases:ManagementPoints
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MediaMode

Specifies a media mode. The media mode specifies how the client finds a management point to obtain deployment information. Valid values are: - Dynamic. The media contacts a management point that redirects the client to a different management point based on the client location in the site boundaries.

  • SiteBased. The media contacts the specified management point.
Type:MediaMode
Parameter Sets:Dynamic, SiteBased
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImage

Specifies an operating system image object. To obtain an operating system image object, use the Get-CMOperatingSystemImage cmdlet.

Type:IResultObject
Aliases:OperatingSystemImagePackage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Path

Specifies the path to the media file (.wim).

Type:String
Aliases:MediaPath, OutputPath, DriveName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AllowUacPrompt

Indicates that the user access control (UAC) prompt is allowed.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowUnattended

Indicates that unattended operating system deployment is allowed. An unattended operating system deployment does not prompt for network configuration or optional task sequences.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowUnknownMachine

Indicates that provisioning of unknown computers is allowed.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Application

Specifies an array of application objects. To obtain an application object, use the Get-CMApplication cmdlet.

Type:IResultObject[]
Aliases:Applications
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateExpireTime

Specifies the expiration date of the self-signed media certificate.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificatePassword

Specifies, as a secure string, the password to import a certificate. A PKI-issued certificate is added to the boot media for client authentication and communication with a Configuration Manager site.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificatePath

Specifies the path to a PKI certificate.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateStartTime

Specifies a start date for the self-signed media certificate.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Comment

Specifies a comment for a prestaged media file.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-CreatedBy

Specifies the name of an individual or organization responsible for the creation of the prestaged media.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DriverPackage

Specifies an array of driver package objects. To obtain driver package object, use the Get-CMDriverPackage cmdlet.

Type:IResultObject[]
Aliases:DriverPackages, PackageDriver, PackageDrivers
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImageIndex

Specifies the operating system image index.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Package

Specifies an array of package objects. To obtain a package object, use the Get-CMPackage cmdlet.

Type:IResultObject[]
Aliases:Packages
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrestartCommand

Specifies a prestart command. A prestart command is a script or executable that runs before the task sequence.

Type:String
Aliases:PreExecCommandLine
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrestartPackage

Specifies the package object that includes files for the prestart command. To obtain a package object, use the Get-CMPackage cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserDeviceAffinity

Specifies user device affinity. User device affinity associates users with a destination computer. Valid values are: - AdministratorApproval

  • AutoApproval
  • DoNotAllow
Type:UserDeviceAffinityType
Parameter Sets:DoNotAllow, AdministratorApproval, AutoApproval
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Variable

Specifies a task sequence variable. The task sequence variable consists of a name and a value.

Type:Hashtable
Aliases:TaskSequenceVariables, Variables
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Version

Specifies the version information for the media.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False