New-CMPackageDeployment

Creates a package deployment to a Configuration Manager collection.

Syntax

New-CMPackageDeployment
   [-StandardProgram]
   [-Package] <IResultObject>
   -ProgramName <String>
   [-DeployPurpose <DeployPurposeType>]
   [-SendWakeupPacket <Boolean>]
   [-UseUtcForAvailableSchedule <Boolean>]
   [-UseUtcForExpireSchedule <Boolean>]
   [-ScheduleEvent <ScheduleEventType>]
   [-Schedule <IResultObject[]>]
   [-RerunBehavior <RerunBehaviorType>]
   [-RunFromSoftwareCenter <Boolean>]
   [-SoftwareInstallation <Boolean>]
   [-SystemRestart <Boolean>]
   [-PersistOnWriteFilterDevice <Boolean>]
   [-FastNetworkOption <FastNetworkOptionType>]
   [-SlowNetworkOption <SlowNetworkOptionType>]
   [-AllowSharedContent <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-DeviceProgram]
   -PackageName <String>
   -ProgramName <String>
   [-DeployPurpose <DeployPurposeType>]
   [-UseUtc <Boolean>]
   [-RecurValue <Int32>]
   [-RecurUnit <RecurUnitType>]
   [-Rerun <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-DeviceProgram]
   -PackageId <String>
   -ProgramName <String>
   [-DeployPurpose <DeployPurposeType>]
   [-UseUtc <Boolean>]
   [-RecurValue <Int32>]
   [-RecurUnit <RecurUnitType>]
   [-Rerun <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-DeviceProgram]
   [-Package] <IResultObject>
   -ProgramName <String>
   [-DeployPurpose <DeployPurposeType>]
   [-UseUtc <Boolean>]
   [-RecurValue <Int32>]
   [-RecurUnit <RecurUnitType>]
   [-Rerun <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-DeviceProgram]
   [-Program] <IResultObject>
   [-DeployPurpose <DeployPurposeType>]
   [-SendWakeupPacket <Boolean>]
   [-UseUtc <Boolean>]
   [-RecurValue <Int32>]
   [-RecurUnit <RecurUnitType>]
   [-Rerun <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-StandardProgram]
   -PackageName <String>
   -ProgramName <String>
   [-DeployPurpose <DeployPurposeType>]
   [-SendWakeupPacket <Boolean>]
   [-UseUtcForAvailableSchedule <Boolean>]
   [-UseUtcForExpireSchedule <Boolean>]
   [-ScheduleEvent <ScheduleEventType>]
   [-Schedule <IResultObject[]>]
   [-RerunBehavior <RerunBehaviorType>]
   [-RunFromSoftwareCenter <Boolean>]
   [-SoftwareInstallation <Boolean>]
   [-SystemRestart <Boolean>]
   [-PersistOnWriteFilterDevice <Boolean>]
   [-FastNetworkOption <FastNetworkOptionType>]
   [-SlowNetworkOption <SlowNetworkOptionType>]
   [-AllowSharedContent <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-StandardProgram]
   -PackageId <String>
   -ProgramName <String>
   [-DeployPurpose <DeployPurposeType>]
   [-SendWakeupPacket <Boolean>]
   [-UseUtcForAvailableSchedule <Boolean>]
   [-UseUtcForExpireSchedule <Boolean>]
   [-ScheduleEvent <ScheduleEventType>]
   [-Schedule <IResultObject[]>]
   [-RerunBehavior <RerunBehaviorType>]
   [-RunFromSoftwareCenter <Boolean>]
   [-SoftwareInstallation <Boolean>]
   [-SystemRestart <Boolean>]
   [-PersistOnWriteFilterDevice <Boolean>]
   [-FastNetworkOption <FastNetworkOptionType>]
   [-SlowNetworkOption <SlowNetworkOptionType>]
   [-AllowSharedContent <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackageDeployment
   [-StandardProgram]
   [-Program] <IResultObject>
   [-DeployPurpose <DeployPurposeType>]
   [-SendWakeupPacket <Boolean>]
   [-UseUtcForAvailableSchedule <Boolean>]
   [-UseUtcForExpireSchedule <Boolean>]
   [-ScheduleEvent <ScheduleEventType>]
   [-Schedule <IResultObject[]>]
   [-RerunBehavior <RerunBehaviorType>]
   [-RunFromSoftwareCenter <Boolean>]
   [-SoftwareInstallation <Boolean>]
   [-SystemRestart <Boolean>]
   [-PersistOnWriteFilterDevice <Boolean>]
   [-FastNetworkOption <FastNetworkOptionType>]
   [-SlowNetworkOption <SlowNetworkOptionType>]
   [-AllowSharedContent <Boolean>]
   [-DistributeContent]
   [-DistributeCollectionName <String>]
   [-DistributionPointGroupName <String>]
   [-DistributionPointName <String>]
   [-Comment <String>]
   [-AvailableDateTime <DateTime>]
   [-DeadlineDateTime <DateTime>]
   [-UseMeteredNetwork <Boolean>]
   [-CollectionName <String>]
   [-CollectionId <String>]
   [-Collection <IResultObject>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-CMPackageDeployment cmdlet creates a specified software package to computers that belong to a Microsoft System Center Configuration Manager collection.

You can use CollecitonId or CollectionName or Collection to specify the target collection to deploy the package. To specify DeploymentStartDateTime and DeploymentStartDay and DeploymentStartTime, use Start-CMPackageDeployment. The cmdlet always output the new created deployment. You can choose when the package becomes available and when the package deployment expires. You can specify whether System Center Configuration Manager deploys the package only once or repeatedly and what happens when installation fails for a computer.

Examples

Example 1: By ID

PS C:\> New-CMPackageDeployment -PackageId $ReferencePackage.PackageID -ProgramName $ReferenceProgram.ProgramName -CollectionID $Collection.CollectionID -StandardProgram -Comment $Comment -DeployPurpose Available

Example 2: By name

PS C:\> New-CMPackageDeployment -PackageName $ReferencePackage.Name -ProgramName $ReferenceProgram.ProgramName -CollectionName $Collection.Name -StandardProgram -Comment $Comment -DeployPurpose Available

Example 3: By pipeline

PS C:\> $ReferencePackage | New-CMPackageDeployment -ProgramName $ReferenceProgram.ProgramName -Collection $Collection -StandardProgram -Comment $Comment -DeployPurpose Available

Parameters

-AllowSharedContent

Indicates whether clients use shared content. If this value is $True, clients attempt to download content from other clients that downloaded that content. If this value is $False, clients do not attempt to download from other clients.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AvailableDateTime

Specifies, as a DateTime object, the date and time that the deployment becomes available. To obtain a DateTime object, use the Get-Date cmdlet.

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

Specifies the user collection.

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

Specifies the ID of a device or user collection.

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

Specifies the name of a user collection.

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

Specifies a comment for the deployment.

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:None
Accept pipeline input:False
Accept wildcard characters:False
-DeadlineDateTime

Specifies, as a DateTime object, the date and time that the deployment expires. To obtain a DateTime object, use the Get-Date cmdlet.

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

Specifies the purpose for the deployment. The acceptable values for this parameter are:

  • Available
  • Required
Type:DeployPurposeType
Accepted values:Available, Required
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeviceProgram

Specifies a device program.

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

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

Specifies the distribution collection name.

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

Specifies the distribution content.

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

Specifies the distribution point group name.

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

Specifies the distribution point name.

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

Specifies client behavior on a fast network. The acceptable values for this parameter are:

  • DownloadContentFromDistributionPointAndRunLocally
  • RunProgramFromDistributionPoint
Type:FastNetworkOptionType
Accepted values:RunProgramFromDistributionPoint, DownloadContentFromDistributionPointAndRunLocally
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Specifies a package object. To obtain a package object, use the Get-CMPackage cmdlet.

Type:IResultObject
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-PackageId

Specifies the ID of a package.

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

Specifies the name of a package.

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

Indicates whether to enable write filters for embedded devices. For a value of $True, the device commits changes during a maintenance window. This action requires a restart. For a value of $False, the device saves changes in an overlay and commits them later.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Program

Specifies a program.

Type:IResultObject
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ProgramName

Specifies the name of a program.

Type:String
Aliases:StandardProgramName, DeviceProgramName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RecurUnit

Specifies a unit for a recurring deployment. The acceptable values for this parameter are:

  • Days
  • Hours
  • Minutes
Type:RecurUnitType
Accepted values:Minutes, Hours, Days
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RecurValue

Specifies how often a deployment recurs. This parameter depends on the unit type specified in the RecurUnit parameter. This value can be between 1 and 23 if the unit is Hours, between 1 and 31 if the unit is Days, or between 1 and 59 if the unit is Minutes.

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

Indicates whether the deployment reruns. If this value is $True, the deployment runs again for clients as specified in the RerunBehavior parameter. If this value is $False, the deployment does not run again.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RerunBehavior

Specifies how a deployment reruns on a client. The acceptable values for this parameter are:

  • AlwaysRerunProgram. Rerun as scheduled, even if the deployment succeeded. You can use this value for recurring deployments.
  • NeverRerunDeployedProgram. Does not rerun, even if the deployment failed or files changed.
  • RerunIfFailedPreviousAttempt. Rerun, as scheduled, if the deployment failed on the previous attempt.
  • RerunIfSucceededOnpreviousAttempt. Rerun only if the previous attempt succeeded. You can use this value for updates that depend on the previous update.
Type:RerunBehaviorType
Accepted values:NeverRerunDeployedProgram, AlwaysRerunProgram, RerunIfFailedPreviousAttempt, RerunIfSucceededOnPreviousAttempt
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunFromSoftwareCenter

Indicates whether to run from Software Center.

Type:Boolean
Aliases:AllowUsersRunIndependently
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Schedule

Specifies a schedule object for the deployment.

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

Specifies an array of schedule event types. The acceptable values for this parameter are:

  • AsSoonAsPossible
  • LogOff
  • LogOn
  • SendWakeUpPacket
Type:ScheduleEventType
Accepted values:AsSoonAsPossible, LogOn, LogOff
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SendWakeupPacket

Indicates whether to send a wake up packet to computers before the deployment begins. If this value is $True, Configuration Manager wakes a computer from sleep. If this value is $False, it does not wake computers from sleep. For computers to wake, you must first configure Wake On LAN.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SlowNetworkOption

Specifies how Configuration Manager deploys this package in a slow network. The acceptable values for this parameter are:

  • DoNotRunProgram
  • DownloadContentFromDistributionPointAndLocally
  • RunProgramFromDistributionPoint
Type:SlowNetworkOptionType
Accepted values:DoNotRunProgram, DownloadContentFromDistributionPointAndLocally, RunProgramFromDistributionPoint
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SoftwareInstallation

Indicates whether to install the deployed software outside of maintenance windows. A maintenance window is a specified period of time used for computer maintenance and updates. If this value is $True, the Configuration Manager installs software according to schedule, even if the schedule falls outside a maintenance window. If this value is $False, Configuration Manager does not install deployed software outside any windows, but waits for a maintenance window.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StandardProgram

Indicates that the program type in the deployment package is standard program.

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

Indicates whether a system restarts outside a maintenance window. A maintenance window is a specified period of time used for computer maintenance and updates. If this value is $True, any required restart takes place without regard to maintenance windows. If this value is $False, the computer does not restart outside a maintenance window.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UseMeteredNetwork

Indicates whether to allow clients to download content over a metered Internet connection after the deadline, which may incur additional expense.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UseUtc

Indicates whether to use Coordinated Universal Time (UTC), also known as Greenwich Mean Time. If this value is $True, Configuration Manager uses UTC for this deployment. If this value is $False, Configuration Manager uses local time.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UseUtcForAvailableSchedule

Indicates whether to use UTC for available schedule. If this value is $True, Configuration Manager uses UTC. If this value is $False, Configuration Manager uses local time.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UseUtcForExpireSchedule

Indicates whether to use UTC for expire schedule. If this value is $True, Configuration Manager uses UTC. If this value is $False, Configuration Manager uses local time.

Type:Boolean
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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object