Editer l'article Suivre ce blog Administration + Créer mon blog

[SCCM] [Powershell] Report DPs errors in csv

Publié le par damcuvelier

Connect to SCCM:

In admin console type it:

Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
New-PSDrive -Name <yoursitecode> -PSProvider "AdminUI.PS.Provider\CMSite" -Root "<your SCCM server's FQDN>" -Description "SCCM Site"

Get all DP informations:

Get-CMDistributionPoint | Select-Object NetworkOsPath,RoleName,SiteCode | Export-Csv -Path <csv path> -NoTypeInformation

Get All Errors in a csv file:

Get-CMDistributionStatus | Where-Object {$_.NumberErrors -ge 1} | Format-Table -AutoSize -Property SmsProviderObjectPath, NumberErrors, NumberInProgress, NumberSuccess, PackageID, Targeted | Format-List | Export-Csv -Path <csv path> -NoTypeInformation

The result is 2 CSV File, one with all DP informations, and another with all errors in all DP.

So you can connect to the DPs with the errors and correct them.

Commenter cet article