Currently I'm trying to find the most efficient way to automate the package deployment process using powershell. The script I'm using at the moment is returning Message ID 100035(waiting for content) under the deployment status, and the CAS logs say
<![LOG[Requesting content SKG00054.1, size(KB) 1344, under context System with priority Low]LOG]!><time="11:18:46.382+
<![LOG[Submitted CTM job {1CA3F8E4-13DA-1483-9F8E-
<![LOG[Successfully created download request {2CEK4BA5-FD7D-4529-A04D-
<![LOG[Location update from CTM for content SSKG00054.1 and request {2CEK4BA5-FD7D-4529-A04D-
<![LOG[Download request only, ignoring location update]LOG]!><time="11:18:47.
Execmgr logs:
<![LOG[Execution Request for advert SKG200BB package SKG00054 program * state change from WaitingDependency to WaitingContent]LOG]!><time="
<![LOG[Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SKG00054",ProgramID="*",
actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l]LOG]!><time="11:18:46.601+
<![LOG[Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SKG00054",ProgramID="*",
actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l]LOG]!><time="11:18:46.741+
I'm unsure why the advertisement isn't deploying properly, because the properties look identical to previous packages I've sent manually. One thing I may think be the issue is that I'm adding the package to a Distribution Point Group which I know may disrupt deployments if a package has already previously been assigned to it I believe.
$sitename = "SKG"
Function create-PKGDeployment
{
$targetcoll = gwmi -ns "root\SMS\Site_$sitename" -class SMS_Collection | WHERE {$_.Name -eq 'Lab'}
$collID = $targetcoll.CollectionID
$collName = $targetcoll.Name
$PKG = gwmi -ns "root\SMS\Site_$sitename" -class SMS_Package | WHERE {$_.name -eq 'Firefox'}
$PKGID = $PKG.PackageID
$PKGName = $PKG.Name
$AdvName = $PKGName+"_"+$PKGID+"_"+$collName
[ARRAY]$PackageID = $PKGID;
Invoke-WmiMethod -Namespace "Root\SMS\Site_SKG" -Name AddPackages -Path "SMS_DistributionPointGroup.GroupID='{1PKU8557-9153-4C39-8DHK-DB0C53H801BA}'" `
-ArgumentList ( ,$PackageID)
$Format = get-date -format yyyyMMddHHmmss
$Date = $Format + ".000000+***"
$AdvArgs = @{
AdvertisementName = "$AdvName";
CollectionID = $collID;
PackageID = $PKGID;
SourceSite = $sitename;
ActionInProgress = 2
PresentTime = $Date
ExpirationTime = $Date
PresentTimeEnabled = $true
ProgramName = "*";
AdvertFlags = 33751072;
RemoteClientFlags = 2128;
TimeFLags = 8193
}
Set-WmiInstance -Class SMS_Advertisement -arguments $AdvArgs -namespace "root\SMS\Site_$sitename" | Out-Null
}
Create-PkgDeployment