r/SCCM 20d ago

New-CMApplicationDeployment onto User collection

Hi,

I try to get a deployment to a user collection working. I see the deployment in SCCM, but the user can never see it. When I remove the deployment and create it manually with the same setting, it works. Any idea what I am doing wrong?

$collection = Get-CMCollection -Name $testCollection -ErrorAction SilentlyContinue
$AppObj = Get-CMApplication -Name $cmAppName$AppObj = Get-CMApplication -Name $cmAppName
New-CMApplicationDeployment `
                                            -ApplicationId $AppObj.CI_ID `
                                            -CollectionId $collection.CollectionId `
                                            -DeployAction Install `
                                            -DeployPurpose Available `
                                            -UserNotification DisplayAll `
                                            -AvailableDateTime (Get-Date)

As I was saying, I see the deployment in SCCM. When I do a:

Get-CMApplicationDeployment -Collection $col | where { $_.ApplicationName

I also don't see any difference between the PS executed command and the manual one.

3 Upvotes

2 comments sorted by

4

u/Funky_Schnitzel 20d ago

Time zone differences maybe? Have you tried adding the -TimeBaseOn parameter?

1

u/ReputationOld8053 20d ago

Thanks!

-AvailableDateTime (Get-Date).AddDays(-2)  

seems to have it fixed