question

DominiqueDUCHEMIN-4668 avatar image
0 Votes"
DominiqueDUCHEMIN-4668 asked DucheminDominique-7551 answered

WMI versus Content Library

Hello,

I ran a script and its results are:
Items in WMI but not the Content Library
========================================
UCP00128.3e4a13ad
UCP00128.3e4a61cd

The package UCP00128 does not exist anywhere in the Console ... what should I do to clear this discrepancy between WMI and Content Libray?

139637-2021-10-11-16-20-25-vspsccmdp01-status-01.png

I compare

PS C:\Windows\system32> Get-ChildItem F:\SCCMContentLib\PkgLib*.ini | out-file dir.txt

PS C:\Windows\system32> Get-WmiObject -namespace root\sccmdp -class SMS_PackagesInContLib | format-list -Property PackageID | out-file wmi.txt

the two files have the same packages...

Thanks,
Dom


mem-cm-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Amandayou-MSFT avatar image
1 Vote"
Amandayou-MSFT answered

Hi @DominiqueDUCHEMIN-4668,

Could we know which sccm version is used? 2012 or other? If it is 2012, there is a status message in the Details tab in the Details pane that shows there was a failure to retrieve the package list, we could try to check smsdpmon.log file on the distribution point to see if there is any error in it, and do these operation to try to solve it.

If the package is not on the site, we must remove the package from WMI on the distribution point. The namespace to connect to is rootsccmdp. The class that contains the list of packages expected is SMS_PackagesInContLib. The simplest way to find the package and remove it from WMI is to run a query on the distribution point such as the following, and then delete the object that is returned, update the content on the distribution point for package.

If the version is not 2012, we could use the above method to solve the problem.

For more details, please refer to these articles:
https://techcommunity.microsoft.com/t5/configuration-manager-archive/troubleshooting-content-mismatch-warnings-on-a-distribution/ba-p/273094
http://henkhoogendoorn.blogspot.com/2015/07/the-package-list-in-content-library.html
Note: Non-Microsoft link, just for the reference.



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DucheminDominique-7551 avatar image
0 Votes"
DucheminDominique-7551 answered DucheminDominique-7551 edited

Hello,

MEMCM 2103 + KB10036164 + KB10372804
Smsdpmon.log on VSPSCCMDP01
The only error seen in this file is:
Failed to find algorithm ID from registry. Use default algorithm. SMS_Distribution_Point_Monitoring 10/11/2021 4:32:36 PM 6300 (0x189C)
List
$WMIPkgList = Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object
$ContentLib = (Get-ItemProperty HKLM:SOFTWARE\Microsoft\SMS\DP).ContentLibraryPath
$PkgLibPath = ($ContentLib) + "\PkgLib"
$PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object)
$PkgLibList = ($PKgLibList | ForEach-Object {$_.replace(".INI","")})
$PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru

section 1

Write-Host Items in WMI but not the Content Library
Write-Host ========================================
$PksinWMIButNotContentLib
Foreach ($Pkg in $PksinWMIButNotContentLib){
Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib -Filter "PackageID = '$Pkg'" | Remove-WmiObject -Confirm
}
Results
PS C:\Windows\system32> C:\source\Script-Invalid_Content.ps1
Items in WMI but not the Content Library
========================================
UCP00128.3e4a13ad
UCP00128.3e4a61cd


Delete
$WMIPkgList = Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object
$ContentLib = (Get-ItemProperty -path HKLM:SOFTWARE\Microsoft\SMS\DP -Name ContentLibraryPath)
$PkgLibPath = ($ContentLib.ContentLibraryPath) + "\PkgLib"
$PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object)
$PkgLibList = ($PKgLibList | ForEach-Object {$.replace(".INI","")})
$PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $
.SideIndicator -eq "<=" }
$PksinContentLibButNotWMI = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "=>" }
Write-Host Delete these items from WMI:
$PksinWMIButNotContentLib
Write-Host Delete .INI files of these packages from the PkgLib folder:$PksinContentLibButNotWMI
Results:
PS C:\Windows\system32> C:\source\Script-DeleteInvalid Content.ps1
Delete these items from WMI:
Delete .INI files of these packages from the PkgLib folder:

The two scripts do not detect the same packages ...

How to delete the packages from the WMI?
I tried:
gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib where PackageID = 'UCP00128.3e4a13ad'" | Remove-WmiObject

And then run the first script but the two packages still appears as to be removed...

Thanks,
Dom

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Amandayou-MSFT avatar image
1 Vote"
Amandayou-MSFT answered

Hi,

gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib where PackageID = 'UCP00128.3e4a13ad'" | Remove-WmiObject

The PackageID = 'UCP00128.3e4a13ad' seems to be wrong.

We could run the following powershell to check how many package there are.
gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib"

And then run the following command:
gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib where PackageID ='PRI0002c'"| Remove-WmiObject
Note: please input your PackageID

Finally, we check if the Package is deleted by running the following powershell:
gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib"

Besides, we could check the packageID on the side of sccm console:

140079-10131.png



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread



10131.png (2.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DucheminDominique-7551 avatar image
0 Votes"
DucheminDominique-7551 answered Amandayou-MSFT commented

Hello,

I ran:
gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib"

there are 516 packages listed

But there is no package with a name where we have "UCP00128" so I could not run this command !!!
gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib where PackageID ='UCP00128.3e4a13ad'"| Remove-WmiObject

I tried also ='UCP00128' but there is nothing with this name in the list...
It seems the two names in the WMI are names used during the build of the package and not the final names... as they have the same root UCP00128 but different extensions...

Also there is no package with this name in the console:
141011-2021-10-15-16-52-06-package-to-be-deleted-01.png

1) Get-ChildItem F:\SCCMContentLib\PkgLib*.ini | out-file dir.txt

2) Get-WmiObject -namespace root\sccmdp -class SMS_PackagesInContLib | format-list -Property PackageID | out-file wmi.txt


Nothing with the name UCP00128 ???
but still having all these errors on the distribution points ...
"Failed to retrieve the package list on the distribution point. Or the package list in content library doesn't match the one in WMI."

Thanks,
Dom



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

PS C:\Windows\system32> Get-ChildItem F:\SCCMContentLib\PkgLib*.ini | out-file dir.txt

This command shows the list of SCCMContentLib\PkgLib on the side of contentlibrary.

PS C:\Windows\system32> Get-WmiObject -namespace root\sccmdp -class SMS_PackagesInContLib | format-list -Property PackageID | out-file wmi.txt

gwmi -Namespace root\sccmdp -Query "select * from SMS_PackagesInContLib"

These commands both show the list of Wmi, so these results could be the same.

As we mentioned, the command of Get-WmiObject has the UCP00128, but gwmi -Namespace root has not the UCP00128, it is abnormal. The results of the two commands I run are the same.

1 Vote 1 ·
DucheminDominique-7551 avatar image
0 Votes"
DucheminDominique-7551 answered DucheminDominique-7551 edited

Hello,

The package UCP00128 should not be there anymore, what should be done to clear the SMS_PackagesInContLib?
But don't forget the items shown in difference does not reflect the package itself but most likely temporary files with extensions..,
UCP00128.3e4a13ad
UCP00128.3e4a61cd

I checked Administration\Overview\Distribution Points. Right-click the distribution point server and select Properties. Go to Content tab, the package UCP00128 does not exist on any Distribution Points.

Thanks,
Dom

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DucheminDominique-7551 avatar image
0 Votes"
DucheminDominique-7551 answered

Still trying to fix this "Failed to retrieve the package list of the distribution point"....
nothing found so far in the logs...

Thanks,
Dom

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.