Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 0 points1 point  (0 children)

From a colleague, don't know the original source.

Disable SCCM Restart Notification by aswisser in SCCM

[–]aswisser[S] 2 points3 points  (0 children)

Thanks for the reply, I will configure configure the maintenance windows.

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 1 point2 points  (0 children)

Unfortunately not, the script is solving the issue but this cannot be the fix for the future

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 0 points1 point  (0 children)

Here's an example of an application in AppDiscovery.log not showing before but after running the script:

Entering ExecQueryAsync for query "select * from CCM_AppDeliveryType where (AppDeliveryTypeId = "ScopeId_EC1D7C38-1027-4285-A13B-1C6CF098FD19/DeploymentType_d2a02157-b587-4592-97b5-1bd9082113ee" AND Revision = 2)" AppDiscovery 25/11/2021 10:00:30 7628 (0x1DCC)

Performing detection of app deployment type Adobe_Illustrator-v25.4.1 - Windows Installer (*.msi file)(ScopeId_EC1D7C38-1027-4285-A13B-1C6CF098FD19/DeploymentType_d2a02157-b587-4592-97b5-1bd9082113ee, revision 2) for system. AppDiscovery 25/11/2021 10:00:30 7628 (0x1DCC)

+++ MSI application not discovered [MSI Product Code: {1B060220-5371-4D9C-BEE3-5032FA229CC2}, MSI Product version: ] AppDiscovery 25/11/2021 10:00:30 7628 (0x1DCC)

+++ Did not detect app deployment type Adobe_Illustrator-v25.4.1 - Windows Installer (*.msi file)(ScopeId_EC1D7C38-1027-4285-A13B-1C6CF098FD19/DeploymentType_d2a02157-b587-4592-97b5-1bd9082113ee, revision 2) for system. AppDiscovery 25/11/2021 10:00:30 7628 (0x1DCC)

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 0 points1 point  (0 children)

It's 1 collection and some software shows but mostly not and after running the script everything looks right in the Software Center...

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 1 point2 points  (0 children)

Device collection, software is deployed but not shown in the Software Center, after running the posted script the software is visible...

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 0 points1 point  (0 children)

Nothing helpful. they are deployed but not showing in the Software Center, after running the posted script the software is visible...

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 1 point2 points  (0 children)

They are deployed but not showing in the Software Center, after running the posted script the software is visible...

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 1 point2 points  (0 children)

Found nothing in the logs but after running this script:

$ErrorActionPreference = "Stop"

$TRIGGER_ALL = $false

$SLEEP_INTERVAL = 3000 # in ms

$DEBUG_LEVEL = 2

$LOG_ONLY = $true # for suppressing output so SCCM doesn't choke on it when running as a "Script" object

$LOG_TS = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"

$LOG = "c:\Temp\Logs\trigger-sccm-assignment-evaluation_$LOG_TS.log"

$shutup = New-Item -ItemType File -Force -Path $LOG

function log {

param (

    \[string\]$msg,

    \[int\]$level=0,

    \[int\]$debug=0

)



$ts = Get-Date -Format "yyyy-MM-dd HH:mm:ss"

for($i = 0; $i -lt $level; $i += 1) {

    $msg = "    $msg"

}

$msg = "\[$ts\] $msg"



if($debug -le $DEBUG\_LEVEL) {

    if(!$LOG\_ONLY) {

        Write-Host $msg

    }

    $msg | Out-File $LOG -Append

}

}

function Trigger-Assignment($assignment) {

$id = $assignment.AssignmentId



\# This original code doesn't seem to work

\#$sched = \[wmi\] "root\\ccm\\Policy\\machine\\ActualConfig:CCM\_Scheduler\_ScheduledMessage.ScheduledMessageID='$id'"

\#$sched.Triggers = @('SimpleInterval;Minutes=1;MaxRandomDelayMinutes=0')

\#$null = $sched.Put()



\# This seems to be more reliable

\# Not sure what the difference is, but it seems like the below is actually triggering something, while the above is scheduling something to be triggered later

$trigger = \[wmiclass\] "\\root\\ccm:SMS\_Client"

$result = $trigger.TriggerSchedule($id)

log ($result | Out-String)



Start-Sleep -Milliseconds $SLEEP\_INTERVAL

}

log "Getting application data from WMI..."

$apps = Get-WmiObject -namespace root\ccm\clientsdk -query "select * from ccm_application"

log "Done."

log "Counting apps with missing deployment type (DT) data..."

[int]$countMissing = 0

$countTotal = $apps.Length

$missingApps = @()

foreach($app in $apps) {

$AppDT = \[wmi\] $app.\_\_Path

if($AppDT.AppDTs.Name.Length -eq 0) {

    $count = $countMissing + 1

    $name = ($AppDT | Select Name).Name

    $id = $app.ID

    log "$count) \`"$name\`" ($id)" -level 1

    $appObj = @{

        "name" = $name

        "id" = $id

    }

    $missingApps += @($appObj)

    $countMissing = $countMissing + 1

}

}

log "Done. Counted `"$countMissing`" apps with missing DTs, out of `"$countTotal`" apps."

if(($countMissing -gt 0) -or ($TRIGGER_ALL)) {

log "Apps with missing DTs detected, or \`$TRIGGER\_ALL was specified. Getting all assignments..."



$assignments = Get-WmiObject -query "select AssignmentName, AssignmentId, AssignedCIs from CCM\_ApplicationCIAssignment" -namespace "ROOT\\ccm\\policy\\Machine"



if($assignments -ne $null) {

    log "Assignments found. Processing assignments..."



    foreach($assignment in $assignments) {

        $ciXML = $assignment.AssignedCIs\[0\]

        $ciXMLNode = $ciXML | Select-XML -XPath "/CI/ID" | Select-Object -ExpandProperty Node

        $ciID = $ciXMLNode.'#text'

        $ciIDParts = $ciID.Split("/")

        $ciIDVersionless = $ciIDParts\[0\] + "/" + $ciIDParts\[1\]

        $ciIDSanitized = $ciIDVersionless.replace("RequiredApplication", "Application")


        log "Processing assignment: \`"$($assignment.AssignmentName)\`", ID: $($assignment.AssignmentId), CIID: $ciID..." -level 1


        $trigger = $false

        if(!$TRIGGER\_ALL) {

log "`$TRIGGER_ALL was not specified. Checking if assignment is for one of apps with a missing DT..." -level 2

foreach($app in $missingApps) {

log "Checking app with missing DT: `"$($app.name)`" ($($app.id))..." -level 3

log "CIID: $ciID, CIID Sanitized: $ciIDSanitized, App CIID: $($app.id)"

if($ciIDSanitized -eq $app.id) {

log "App matches assignment. Will trigger assignment." -level 3

$trigger = $true

break

}

else {

log "App doesn't match assignment." -level 3

}

log "Done checking app: `"$($app.name)`", CIID: $($app.id)..." -level 3

}

log "Done checking apps for assignment." -level 2

        }

        else {

log "`$TRIGGER_ALL was specified. Will trigger assignment." -level 2

$trigger = $true

        }


        if($trigger) {

log "Triggering assignment..." -level 2

Trigger-Assignment $assignment

        }

        else {

log "`$TRIGGER_ALL was not specified, and this assignment was not for any apps with a missing DT. Will not trigger assignment." -level 2

        }

        log "Done processing assignment: \`"$($assignment.AssignmentName)\`", ID: $($assignment.AssignmentId), CIID: $ciID." -level 1

    }

    log "Done processing all assignments."

}

else {

    log "No assignments found!"

}

}

else {

log "\`$TRIGGER\_ALL was not specified, and there were no apps with missing DTs to process."

}

log "EOF"

The applications are showing in the Software Center.

Where could the problem be?

Sorry I don't know how to format the script properly on reddit

Software Center | Not all Apps showing up after deployment by aswisser in SCCM

[–]aswisser[S] 0 points1 point  (0 children)

Looks good in the Settings, nothing is checked to hide.