Start-cmpackagedeployment error – Impossible to create a Required Package Deployment using CMDLET

Benoit LecoursPowershell, SCCM12 Comments

**Edit 2014/10/31 : I’m still struggling to make this cmdlet work with a Required schedule even if Microsoft says it’s fixed. If you have been able to make it work, leave a comment in this post. Start-cmpackagedeployment error **

**Edit 2014/06/27 : This issue is supposedly fix with R2 CU2 **

The Start-CMPackageDeployment cmdlet is failing with the following error when creating a “Required” deployment with a schedule.

This CMDLet starts the deployment of a software package to a Configuration Manager collection.

Run SCCM cmdlets and scripts by using the SCCM console or by using a Windows PowerShell session. When you run SCCM cmdlets by using the SCCM console, your session runs in the context of the site.

Example : Start-CMPackageDeployment -CollectionName “$Name” -PackageId $PkgId -StandardProgramName “Install”  -DeployPurpose Available -DeploymentAvailableDay “2014/06/13” -DeploymentAvailableTime “12:12” -DeploymentStartDay “2014/06/19” -DeploymentStartTime “2:45”-RerunBehavior RerunIfFailedPreviousAttempt -SoftwareInstallation $True -SystemRestart $False

Error : Start-CMPackageDeployment : Parameter set cannot be resolved using the specified named parameters.

start-cmpackagedeploymentThe command works well when creating an “Available” deployment.

I’ve filed a Microsoft Connect case concerning the issues :

The Microsoft Team confirmed the bug and post this :

Thanks for the feedback. This issue should be resolved in the upcoming R2 CU2 release.

I’ll update this post when CU2 gets available and confirmed that it’s resolved.

Let us know if this tip was helpful for you by using the comments section.

12 Comments on “Start-cmpackagedeployment error – Impossible to create a Required Package Deployment using CMDLET”

  1. I am having a nightmare here. You assistance would be appreciated.

    Start-CMPackageDeployment -CollectionName “Collection1” -PackageName “Package1” -StandardProgramName “Program1” -DeployPurpose Required -DeploymentAvailableDay (get-date) -DeploymentAvailableTime (get-date) -ScheduleEvent AsSoonAsPossible -RerunBehavior RerunIfFailedPreviousAttempt

    I am then asked:

    cmdlet Start-CMPackageDeployment at command pipeline position 1
    Supply values for the following parameters:

    I enter “Program1”

    The error I then get is:

    Start-CMPackageDeployment : Cannot convert ‘System.String’ to the type ‘System.Management.Automation.SwitchParameter’required by parameter ‘StandardProgram’.
    At line:1 char:1

    Your assistance would be greatly received.

  2. I am sorry for the previous one this below one I am trying to use and its giving me same error.

    Start-CMPackageDeployment -CollectionName “$CollectionName” -PackageName “$PackageName” -ProgramName “Install.cmd” -DeployPurpose Required -UseUtcForAvailableSchedule $false -DeploymentStartDay $Date.Day+2 -DeploymentStartTime 06:00 -Rerun $true -RecurUnit Days -RecurValue 1 -RerunBehavior RerunIfFailedPreviousAttempt -AllowUsersRunIndependently $true -SoftwareInstallation $false -SystemRestart $false -FastNetworkOption DownloadContentFromDistributionPointAndRunLocally -SlowNetworkOption DownloadContentFromDistributionPointAndLocally -AllowSharedContent $false

  3. I am trying the below one and not working.

    Start-CMPackageDeployment -CollectionName “$CollectionName” -PackageName “$PackageName” -ProgramName “Install.cmd” -DeployPurpose Required -UseUtcForAvailableSchedule $false -DeploymentStartDay $Date.Day+2 -DeploymentStartTime 06:00 -Rerun $true -RecurUnit Days -RecurValue 1 -RecurStartDay $Date.Date+4 -RecurStartTime 12:00 -RerunBehavior RerunIfFailedPreviousAttempt -AllowUsersRunIndependently $true -SoftwareInstallation $false -SystemRestart $false -FastNetworkOption DownloadContentFromDistributionPointAndRunLocally -SlowNetworkOption DownloadContentFromDistributionPointAndLocally -AllowSharedContent $false

  4. I have been beating my head against a wall trying to get this to work. I have upgraded my console to 5.0.7958.1604 hoping that the latest update would fix this issue. I still do not believe Microsoft has resolved the problems in the Start-CMPackageDeployment cmdlet. Without fail I receive two errors. The first is a warning stating that the result set exceeded the maximum size. The next is an error stating that there are no distribution points or distribution point groups in the package. To be clear, the package exists, a program has been created within the package, and said package has been distributed to all the DPs in my environment. What am I missing?

    1. I just test it again. It was supposed to be fixed in R2 CU2 but I’m still struggling to make it work. I suggest that you submit your comment to my Connect feedback (link in post).

    2. Not sure if you ever got an answer but I just went through this and found a solution that worked for me so I thought I’d leave it here for anyone else who may have run across this.

      1st clue is the first warning message – you need to get the count(*) of everything in SMS_Package
      Like this:
      $PkgCount = (Get-WmiObject -ComputerName $SCCMSiteName -Namespace “Root\SMS\Site_$($SCCMSiteCode)” -Query “SELECT COUNT(*) FROM SMS_Package AS pkg INNER JOIN SMS_DistributionPoint AS srv ON pkg.PackageID = srv.PackageID WHERE pkg.ActionInProgress!=3 AND pkg.PackageType=0”).Count

      Then use Get-CMQueryResultMaximum to get you current maximum and raise it with Set-CMQueryResultMaximum if it is lower than $PkgCount

      2nd clue you can get by using the -verbose switch when using Start-CMPackageDeployment. That will tell you everything that the cmdlet is ACTUALLY doing to figure out which package is yours etc etc. It’s how i got that PkgCount query above.

      From my reasoning I figure that due to CMQueryResultMaximum being defaulted to 1000 and the crazy amount of packages some environments could have in those tables, the cmdlet throws an error thinking that your package hasn’t been distributed yet. When it fact it has! Just never got found due to aforementioned result maximum.

  5. I was able to get a required deployment like this, in CU3:

    Start-CMPackageDeployment -CollectionName $col `
    -PackageName $pkg `
    -ProgramName $pkg `
    -StandardProgram `
    -DeployPurpose Required `
    -FastNetworkOption DownloadContentFromDistributionPointAndRunLocally `
    -SlowNetworkOption DownloadContentFromDistributionPointAndLocally `
    -SoftwareInstallation $true `
    -SystemRestart $false `
    -ScheduleEvent AsSoonAsPossible `
    -RerunBehavior RerunIfFailedPreviousAttempt

    It needs a schedule or a schedule event.

    1. I’m on SCCm 1511 and config man cmdlets 5.0.8328.1155. I’m trying this command:
      Start-CMPackageDeployment -collectionName $rebootCollection.Name `
      -packageName $packageName `
      -programName $standardProgramName `
      -standardProgram `
      -deploymentAvailableTime $deploymentAvailableTime `
      -deploymentExpireTime $deploymentExpireTime `
      -softwareInstallation $true `
      -systemRestart $true `
      -useUTC $false `
      -scheduleevent AsSoonAsPossible `
      -rerunBeahvior “AlwaysRerunProgram”

      and this command:

      Start-CMPackageDeployment -collectionName $rebootCollection.Name `
      -packageName $packageName `
      -programName $standardProgramName `
      -standardProgram `
      -deploymentAvailableTime $deploymentAvailableTime `
      -deploymentExpireTime $deploymentExpireTime `
      -softwareInstallation $true `
      -systemRestart $true `
      -useUTC $false `
      -schedule $deploymentStartTime `
      -rerunBeahvior “AlwaysRerunProgram”

      where $deploymentstarttime is a schedule token created by new-cmschedule.

      Both commands fail with the message “parameter set cannot be resolved using the specified named parameters.”
      I’ve posted a comment on the Connect Feedback.

  6. I still couldnt get this working.
    I am using the below:

    Start-CMPackageDeployment -CollectionName “Test Collection” -PackageName “Powershell test” -StandardProgramName “Powershell” -Schedule $True -AllowSharedContent $True -DeployPurpose Required -DeploymentAvailableDay “2014/09/17” -DeploymentAvailableTime “16:00″ -RecurUnit Days -RecurValue 7 -Rerun $True -DeploymentStartDay “2014/09/17″ -DeploymentStartTime “16:00” -FastNetworkOption DownloadContentFromDistributionPointAndRunLocally -RerunBehavior RerunIfFailedPreviousAttempt -SoftwareInstallation $False

    And still facing issues. Can you please let me know the parameters that you can using ?

    1. I’ve been trying to make it work but it’s obviously still broken. I’m able to create an “Available” deployment but struggling for a Required one.

    2. first and foremost is the warcrimes that we ourselves commit.Assad pales into insignificance compared to Bush, Blair, Camaron, Haig, etc.To point fingers at small fry and ignore the major criminals is to just use warcrimes as a tool of imperialism.No .. of utmost importance is to get our own war criminals to face justice. Otherwise we’re just playing at it.Saying we should concentrate on the ones we can get (and be satisfied with complaining about ours) won’t cut it. We should concentrate on the biggest criminals. The biggest breakthrough in cutting war crimes will be when we bring our own to justice.

Leave a Reply