Share via


針對內容發佈進行疑難解答

本文討論如何針對常見的內容發佈問題進行疑難解答。

原始產品版本:Configuration Manager 最新分支、Microsoft System Center 2012 Configuration Manager、Microsoft System Center 2012 R2 Configuration Manager

範例問題

在此範例中,假設您已將套件發佈至發佈點,但該套件處於 DP 的 「 失敗 」或「 進行中 」狀態。

  1. 首先, 閱 DP 所在的主要/次要) (站臺上的DistMgr.log。

    1. 在記錄檔中尋找 ~Processing 封裝 專案,並識別有問題的封裝標識符的封裝處理線程。 篩選DistMgr.log您識別的線程標識碼。 檢閱將 套件散發至標準 DP 中的步驟 4,以查看記錄摘要。
    2. 檢閱篩選過的記錄,並檢查是否已針對有問題的 DP 建立 DP 線程。 篩選 DistMgr.log 線程標識碼,以簡化此作業。
    3. 檢閱篩選過的記錄,並檢查是否已建立 PkgXferMgr 作業。
  2. 檢閱站臺上的 PkgXferMgr.log (DP 所在的主要/次要) 。

    1. 尋找記錄中標識碼專案的 [找到傳送要求 ],並識別受影響 DP/套件組合的傳送線程。 篩選 PkgXferMgr.log 識別的線程標識碼。 檢閱將 套件散發至標準 DP 中的步驟 6,以查看記錄摘要。
    2. 檢閱篩選過的記錄,以查看內容是否已成功傳輸至 DP,或是否有錯誤。
  3. 針對標準 DPS,PkgXferMgr 會將內容檔案 (的) 複製到 DP,它會指示 DP WMI 提供者呼叫 WMI 方法,將檔案新增至內容庫。 檢閱 DP 上的 SMSDPProv.log ,以確保內容已新增至內容庫。 檢閱將 套件散發至標準 DP 中的步驟 7,以查看記錄摘要。

    針對提取 DPS,PkgXferMgr 會通知提取 DP 起始內容下載。 檢閱 發佈套件以提取 DP 中的步驟 8-16,以瞭解流程並檢閱 PullDP.logDataTransferService.log ,以確保已成功下載內容。

  4. 針對標準 DPS,PkgXferMgr 會將狀態消息傳送至 DistMgr。 檢閱 DistMgr.log 以確認狀態消息是否已成功處理。 檢閱將 套件散發至標準 DP 中的步驟 8,以查看記錄摘要。

    針對提取 DPS,提取 DP 會傳送狀態消息以指出成功。 檢閱 散發套件以提取 DP 中的步驟 16-22,以瞭解流程並檢閱相關的記錄,以確保狀態消息已成功處理。

  5. 如果涉及多個月臺,請確定資料庫複寫正常運作,且相關月臺之間的資料庫連結為作用中。

常見的 DistMgr 問題

  • DistMgr.log 會針對有問題的套件識別碼顯示下列專案:

    SMS_DISTRIBUTION_MANAGER 2732 (0xaac) ~The contents for the package \<PackageID> hasn't arrived from site CS1 yet, will retry later.
    

    這通常會在內容從一個月臺傳輸到另一個月臺時暫時發生。 檢閱寄件者/Despooler 記錄,以確保網站通訊沒有任何問題。 如果您在排程器 -Sender> ->Despooler) (月臺對月台通訊期間看到錯誤,請先專注於解決這些錯誤,然後在DistMgr.log中針對上述訊進行疑難解答。 檢閱 跨網站將套件散發至 DP ,以了解記錄流程。

    如果沒有錯誤,可能需要強制父月臺將套件重新傳送至受影響的網站。 如需詳細資訊,請參閱 將封裝的壓縮複本重新傳送至網站

  • DistMgr.log 可能會顯示正在處理其他套件,並使用所有可用的線程進行封裝處理。

    SMS_DISTRIBUTION_MANAGER 4824 (0x12d8) ~Currently using 3 out of 3 allowed package processing threads.
    

    如果您看到這種情況,請檢閱 DistMgr.log 中目前的套件處理線程,以查看它們是否停滯。 您也可以在下列登入機碼下檢閱封 裝處理佇列正在處理的封裝 登錄值,以查看處理佇列中目前有多少套件:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Components\SMS_DISTRIBUTION_MANAGER

    如果 正在處理的封裝 值未變更,且長時間停滯,則 DistMgr 可能會無回應/停滯。 如果發生這種情況,請擷取 SMSExec.exe 的 進程傾印 以供檢閱。

    如果佇列中有許多套件,但佇列正在移動,則可能需要檢閱並變更線程設定。

  • DistMgr.log 不會處理傳入的 PKN 檔案,因此不會處理套件。 這會導致在 DistMgr 收件匣中積存 PKN 檔案。

    PKN 檔案是由主要 DistMgr 線程處理,因此在這些情況下,尋找 SMS_EXECUTIVE開始 SMS_DISTRIBUTION_MANAGER記錄項目來識別主要 DistMgr 線程標識符會很有説明,然後篩選所識別線程標識符的 DistMgr.log

    在大部分情況下,當主要 DistMgr 線程對遠端 DP 進行 WMI 呼叫,但 DP 上的 WMI 沒有回應,導致 DistMgr 無限期等候它時,就會發生此問題。 篩選主要 DistMgr 線程的 DistMgr.log 可以提供其嘗試通訊之 DP 的線索。 一旦識別出來,請檢查 DP 是否回應,且 WMI 在 DP 上正常運作。 如有必要,請重新啟動 DP,以查看這是否有説明。

    如果篩選的 DistMgr.log 未提供任何線索,請擷取 SMSExec.exe 在問題狀態下進行檢閱的 程序傾印

常見的 PkgXferMgr 問題

  • PkgXferMgr.log 在 DP 上將檔案新增至內容庫時顯示錯誤:

    SMS_PACKAGE_TRANSFER_MANAGER 5744 (0x1670) ~Sending completed  
    [D:\SCCMContentLib\FileLib\B53B\B53B6F96ECC3FB2AF59D02C84A2D31434904BACF2F9C90D80107B6602860BCFD]  
    SMS_PACKAGE_TRANSFER_MANAGER 5744 (0x1670) ~ExecStaticMethod failed (80041001)  
    SMS_DistributionPoint, AddFile  
    SMS_PACKAGE_TRANSFER_MANAGER 5744 (0x1670) CSendFileAction::AddFile failed; 0x80041001  
    SMS_PACKAGE_TRANSFER_MANAGER 5744 (0x1670) ~Deleting remote file  
    \\DPNAME.CONTOSO.COM\SMS_DP$\Content_b034813c-bc60-4a16-b471-7a0dc3d9662b.1-B53B6F96ECC3FB2AF59D02C84A2D31434904BACF2F9C90D80107B6602860BCFD  
    SMS_PACKAGE_TRANSFER_MANAGER 5744 (0x1670) ~ Sending failed. Failure count = 1, Restart time = 12/4/2014 6:14:27 AM Eastern Standard Time
    

    PkgXferMgr 將內容檔案複製到 DP 之後,它會執行 WMI 方法來指示遠端 DP 將檔案新增至內容庫。 如果遠端 DP 無法將檔案新增至內容庫,您會在PkgXferMgr.log中看到一般 WMI 錯誤 (0x80041001 = WBEM_E_FAILED)

    發生這種情況時,必須檢閱 DP 上的 SMSDPProv.log ,以找出 DP 無法將檔案新增至內容庫的原因。 如果您在SMSDPProv.log中看到找不到檔案/路徑的錯誤,您必須擷取進程監視器追蹤來判斷失敗的原因。

  • PkgXferMgr.log 顯示 DP 只允許一個連線:

    SMS_PACKAGE_TRANSFER_MANAGER 21216 (0x52e0) ~Address to DPNAME.CONTOSO.COM is currently under bandwidth control, therefore only one connection is allowed, returning send request to the pool.
    

    SMS_PACKAGE_TRANSFER_MANAGER 21216 (0x52e0) ~Address to DPNAME.CONTOSO.COM is currently in pulse mode, therefore only one connection is allowed.
    

    如果 PkgXferMgr.log 顯示「只允許一個連線」到 DP,表示 DP 已設定為頻寬節流。 如果是這種情況,PkgXferMgr 只能針對 DP 使用一個線程,因此一次只能將一個套件傳送至 DP。 如需詳細資訊,請參閱 頻寬控件和線程

  • PkgXferMgr.log 顯示位址已關閉:

    SMS_PACKAGE_TRANSFER_MANAGER 7156 (0x1BF4) Address is closed for priority 2 jobs, stop sending[E:\SCCMContentLib\FileLib\2F08\2F0819F959E788CF843F42E9CA7B44E258B8B4BA37BB63902DB39ACF747BE7DA]  
    SMS_PACKAGE_TRANSFER_MANAGER 7156 (0x1BF4) Deleting remote file \\DPNAME.CONTOSO.COM\SMS_DP$\<PackageID>.6-2F0819F959E788CF843F42E9CA7B44E258B8B4BA37BB63902DB39ACF747BE7DA  
    SMS_PACKAGE_TRANSFER_MANAGER 7156 (0x1BF4) CSendFileAction::SendFiles failed; 0x80004005  
    SMS_PACKAGE_TRANSFER_MANAGER 7156 (0x1BF4) Sending failed. Failure count = 1, Restart time = 3/15/2016 8:30:08 AM Mountain Daylight Time
    

    如果您在記錄中看到此資訊,表示 DP 處於頻寬控制之下,而 DP 的位址會在內容傳輸進行中時關閉。 在上述範例中,DP 排程已設定為只在上午 8:00 到上午 10:00 時才 允許高優先順序 。 因此,PkgXferMgr 在上午 8:00 停止傳送內容,並將套件/DP 標示為失敗狀態。

  • PkgXferMgr.log 顯示相同作業同時啟動的多個線程:

    SMS_PACKAGE_TRANSFER_MANAGER 8360 (0x20a8) Sending thread starting for Job: 12771, package: <PackageID>, Version: 8, Priority: 2, server: DPNAME.CONTOSO.COM, DPPriority: 200  
    SMS_PACKAGE_TRANSFER_MANAGER 10752 (0x2a00) Sending thread starting for Job: 12771, package: <PackageID>, Version: 8, Priority: 2, server: DPNAME.CONTOSO.COM, DPPriority: 200  
    SMS_PACKAGE_TRANSFER_MANAGER 12208 (0x2fb0) Sending thread starting for Job: 12771, package: <PackageID>, Version: 8, Priority: 2, server: DPNAME.CONTOSO.COM, DPPriority: 200  
    SMS_PACKAGE_TRANSFER_MANAGER 4244 (0x1094) Sending thread starting for Job: 12771, package: <PackageID>, Version: 8, Priority: 2, server: DPNAME.CONTOSO.COM, DPPriority: 200  
    SMS_PACKAGE_TRANSFER_MANAGER 8348 (0x209c) Sending thread starting for Job: 12771, package: <PackageID>, Version: 8, Priority: 2, server: DPNAME.CONTOSO.COM, DPPriority: 200
    

    一般而言,PkgXferMgr 會針對某個作業使用一個線程,但如果在相同的作業中使用多個線程,則內容傳輸可能會因為 錯誤0x80070020 (ERROR_SHARING_VIOLATION) 而開始失敗。 如果站臺伺服器和月臺資料庫伺服器位於不同的時區,就會發生這種情況。 這裡的解決方案是確保月臺伺服器和月臺資料庫伺服器已設定相同的時區。

常見的提取 DP 問題

  • PkgXferMgr.log 顯示提取 DP 在容量中,而且沒有其他作業會傳送至提取 DP:

    SMS_PACKAGE_TRANSFER_MANAGER 4712 (0x1268) PullDP ["Display=\\P01PDP1.CONTOSO.COM\"]MSWNET:["SMS_SITE=P01"]\\P01PDP1.CONTOSO.COM\ has reached maximum capacity 50  
    SMS_PACKAGE_TRANSFER_MANAGER 4712 (0x1268) ~ PullDP has no capacity. Restart time = 1/10/2019 1:16:33 PM Eastern Standard Time
    

    PkgXferMgr 會執行下列查詢,以檢查提取 DP 上目前有多少作業處於未完成狀態。 如果查詢傳回超過 50 個作業,則不會將任何其他作業傳送至提取 DP。

    SELECT COUNT(*) FROM DistributionJobs job
    JOIN DistributionPoints dp ON dp.DPID=job.DPID AND dp.NALPath='["Display=\\P01PDP1.CONTOSO.COM\"]MSWNET:["SMS_SITE=P01"]\\P01PDP1.CONTOSO.COM\'
    WHERE job.State in (2, 3, 4) AND (job.Action<>5) AND (ISNULL(job.SendAction, '') <> '')
    

    當提取 DP 傳送成功狀態消息或狀態輪詢停止時,這些作業會從DistributionJobs數據表中移除, (根據) 設定的值。 若要查看提取 DP 上的作業,您可以使用 wbemtest 或 WMI Explorer 來檢閱類別的 SMS_PullDPNotification 實例計數。 您也可以檢閱 ROOT\SCCMDP:SMS_PullDPState 提取 DP 上的 WMI 類別實例,以識別處於 失敗 狀態的套件,並 檢閱PullDP.log 以及 DataTransferService.log 來調查失敗。

  • SignatureDownload 提取 DP 上的作業失敗,並出現 HTTP 404 錯誤。

    已建立套件的 SignatureDownload DTS 作業 {JOBID}C010000D.28,內容識別碼 ContentID。 JobState = NotStarted
    針對C010000D.28、內容作業 {JOBID}、0x80070002收到的 DTS 錯誤訊息:BITS 錯誤:『HTTP 狀態 404:伺服器上沒有要求的 URL。

    這是已知問題,因為簽章檔案不存在於月臺伺服器上共置的來源 DP 上。 只有在散發動作未 轉散發時,才會發生此問題。

    若要解決這個問題,請使用下列其中一個方法:

    • 轉散發套件 (重新發佈套件不需要下載簽章,因為完整內容會下載) 。
    • 將提取 DP 設定為使用未共置在月臺伺服器上的來源 DP。
  • DataTransferService.log 嘗試從來源 DP 下載內容時顯示0x800706D9:

    DataTransferService 4864 (0x1300) CDTSJob::HandleErrors: DTS Job '{5285F8B3-C426-4882-85F2-AD5331DD4179}' BITS Job '{D53BA625-24AA-41FA-A357-6EB1B7D7E701}' under user 'S-1-5-18' OldErrorCount 29 NewErrorCount 30 ErrorCode
    

    0x800706D9表示端點對應程式不再提供任何端點。 此問題可能是因為防火牆所造成的 RPC 埠配置失敗所造成。 也可能會在停用 Windows 防火牆 服務時發生。

    檢查站台伺服器與受影響的伺服器之間是否有防火牆,並瞭解 RPC 埠 是否已開啟。 您也可以從提取 DP 擷取 網路追蹤 (,以及在重現錯誤以供檢閱時擷取來源 DP 伺服器) 。

  • 提取 DP 顯示其具有大量作業,但未處理作業。

    在某些情況下,當所有內容都傳送至提取 DP) 時,通常會在安裝新的提取 DP 之後 (,提取 DP 上太多作業失敗可能會導致作業處理停止。 雖然大部分的問題都是在最新版本的產品 (Configuration Manager 1810 版) 中修正,但某些環境因素可能會導致提取 DP 無法處理作業。 發生這種情況時,您可能會在 WMI 類別中 ROOT\ccm\DataTransferService:CCM_DTS_JobEx 看到數千個 DTS 作業,以及 ~50 個 (或更多) 位作業處於 失敗 狀態。 在此案例中,從提取 DP 上的 WMI 移除所有作業特定專案,並以受控制的方式將內容再次發佈至提取 DP,並調查失敗可能會有説明。

    若要從提取 DP 上的 WMI 移除所有作業特定專案,您可以使用下列 PowerShell 腳稿 (檢閱腳本批注以取得說明) :

    Reset-PullDPState.ps1

    <#
    
    .SYNOPSIS  
    Resets the state of the Pull DP and deletes data from various WMI classes related to Pull DP. You need to run this script as Administrator.
    
    .DESCRIPTION
    This script deletes the data from following WMI classes:
    - CCM_DTS_JobEx
    - CCM_DTS_JobItemEx
    - SMS_PullDPState
    - SMS_PullDPContentState
    - SMS_PullDPNotification (optional)
    
    The script also checks and reports the count of BITS Jobs.
    
    .PARAMETER ComputerName
    (Optional) Name of the Pull DP. You can leave this blank for local machine.
    
    .PARAMETER DeletePullDPNotifications
    (Optional) Use this switch if you want to delete the job notifications from SMS_PullDPNotification class.
    
    .PARAMETER KeepBITSJobs
    (Optional) Use this switch if you don't want the script to delete ALL BITS Jobs. If this switch is not used, ALL BITS jobs are deleted (even the ones that are not created by ConfigMgr)
    
    .PARAMETER NotifyPullDP
    (Optional) Use this switch if you want the script to execute NotifyPullDP method against SMS_DistributionPoint class. This is only useful when there aren't a lot of notifications in WMI and -DeletePullDPNotifications switch was not used.
    
    .PARAMETER WhatIf
    (Optional) Use this switch to see how many instances will be deleted.
    
    .EXAMPLE
    Reset-PullDPState -WhatIf
    This command checks how many Pull PD jobs will get deleted when running the script
    
    .EXAMPLE
    Reset-PullDPState
    This command resets the Pull DP related WMI classes except the Pull DP job Notification XML's
    
    .EXAMPLE
    Reset-PullDPState -DeletePullDPNotifications
    This command resets the Pull DP related WMI classes along with the Pull DP job Notification XML's. If you do this, you would need to distribute/redistribute these packages to the Pull DP again.
    
    .NOTES
    07/28/2016 - Version 1.0 - Initial Version of the script
    01/09/2019 - Version 2.0 - Added batch size for instance removal to prevent WMI Quota issues. Also added removal of BITS jobs (can be disabled by using -KeepBITSJobs switch) and restart of CcmExec service.
    
    #>
    
    [CmdletBinding()]
    Param(
      [Parameter(Mandatory=$false)]
       [string]$ComputerName = $env:COMPUTERNAME,
    
       [Parameter(Mandatory=$false)]
       [switch]$DeletePullDPNotifications,
    
       [Parameter(Mandatory=$false)]
       [switch]$KeepBITSJobs,
    
       [Parameter(Mandatory=$false)]
       [switch]$NotifyPullDP,
    
       [Parameter(Mandatory=$false)]
       [switch]$WhatIf
    )
    
    $LogFile = Join-Path (Split-Path $SCRIPT:MyInvocation.MyCommand.Path -Parent) "Reset-PullDPState.log"
    $ErrorActionPreference = "SilentlyContinue"
    
    Function Write-Log {
        Param(
          [string] $text,
          [switch] $NoWriteHost,
          [switch] $IsErrorMessage,
          [switch] $IsWarning,
          [switch] $WhatIfMode
        )
    
        $timestamp = Get-Date -Format "MM-dd-yyyy HH:mm:ss"
        "$timestamp $text" | Out-File -FilePath $LogFile -Append
    
        if ($WhatIfMode) {
            Write-Host $text -ForegroundColor Yellow
            return
        }
    
        if (-not $NoWriteHost) {
            if ($IsErrorMessage) {
                Write-Host $text -ForegroundColor Red
            }
            elseif ($IsWarning) {
                Write-Host $text -ForegroundColor Yellow
            }
            else {
                Write-Host $text -ForegroundColor Cyan
            }
        }
    }
    
    Function Delete-WmiInstances {
        Param(
            [string] $Namespace,
            [string] $ClassName,
            [string] $Filter = $null,
            [string] $Property1,
            [string] $Property2 = "",
            [string] $Property3 = "",
            [int] $BatchSize = 10000
        )
    
        $success = 0
        $totalfailed = 0
        $counter = 0
        $total = 0
    
        Write-Host ""
        Write-Log "$ClassName - Connecting to WMI Class on $ComputerName"
    
        do {
    
            if ($Filter -eq $null) {
                $Instances = Get-WmiObject -ComputerName $ComputerName -Namespace $Namespace -Class $ClassName -ErrorVariable WmiError -ErrorAction SilentlyContinue | Select -First $BatchSize
            }
            else {
                $Instances = Get-WmiObject -ComputerName $ComputerName -Namespace $Namespace -Class $ClassName -Filter $Filter -ErrorVariable WmiError -ErrorAction SilentlyContinue | Select -First $BatchSize
            }
    
            if ($WmiError.Count -ne 0) {
                Write-Log "    Failed to connect. Error: $($WmiError[0].Exception.Message)" -IsErrorMessage
                $WmiError.Clear()
                return
            }
    
            $currentfailed = 0
            $current = ($Instances | Measure-Object).Count
            if ($current -gt 0) {$script:serviceRestartRequired = $true}
            if ($WhatIf) { break }
    
            if ($current -ne $null -and $current -gt 0) {
                Write-Log "    Found $total total instances (Batch size $BatchSize)"
    
                foreach($instance in $Instances) {
    
                    $instanceText = "$Property1 $($instance.$Property1)"
    
                    if ($Property2 -ne "") {
                        $instanceText += ", $Property2 $($instance.$Property2)"
                    }
    
                    if ($Property3 -ne "") {
                        $instanceText += ", $Property3 $($instance.$Property3)"
                    }
    
                    Write-Log "    Deleting instance for $instanceText" -NoWriteHost
                    $counter += 1
    
                    $percentComplete = "{0:N2}" -f (($counter/$total) * 100)
                    Write-Progress -Activity "Deleting instances from $ClassName" -Status "Deleting instance #$counter/$total - $instanceText" -PercentComplete $percentComplete -CurrentOperation "$($percentComplete)% complete"
    
                    Remove-WmiObject -InputObject $instance -ErrorVariable DeleteError -ErrorAction SilentlyContinue
                    if ($DeleteError.Count -ne 0) {
                        Write-Log "    Failed to delete instance. Error: $($DeleteError[0].Exception.Message)" -NoWriteHost -IsErrorMessage
                        $DeleteError.Clear()
                        $currentfailed += 1
                    }
                    else {
                        $success += 1
                    }
                }
    
                $totalfailed += $currentfailed
    
                if ($currentfailed -eq $current) {
                    # Every instance in current batch failed. Break to avoid infinite while loop
                    break
                }
            }
    
        } while (($Instances | Measure-Object).Count -ne 0)
    
        if ($WhatIf) {
            if ($total -eq $BatchSize) {
                Write-Log "    (What-If Mode) Found more than $BatchSize instances which will be deleted" -WhatIfMode
            }
            else {
                Write-Log "    (What-If Mode) $total instances will be deleted" -WhatIfMode
            }
        }
        else {
            if ($total -gt 0) {
                # $totalfailed is likely not the accurate count here as it could include duplicate failures due to batching
                Write-Log "    Deleted $success instances. Failed to delete $totalfailed instances."
            }
            else {
                Write-Log "    Found 0 instances."
            }
        }
    }
    
    Function Check-BITSJobs {
    
        $DisplayName = "BITS Jobs"
    
        Write-Host ""
        Write-Log "$DisplayName - Gettting jobs on $ComputerName"
        Import-Module BitsTransfer
        $Instances = Get-BitsTransfer -AllUsers -Verbose -ErrorVariable BitsError -ErrorAction SilentlyContinue | Where-Object {$_.DisplayName -eq 'CCMDTS Job'}
    
        if ($BitsError.Count -ne 0) {
            Write-Log "    $DisplayName - Failed to get jobs. Error: $($BitsError[0].Exception.Message)" -IsErrorMessage
            $BitsError.Clear()
        }
        else {
            $total = ($Instances | Measure-Object).Count
            Write-Log "    $DisplayName - Found $total jobs"
    
            if ($KeepBITSJobs) {
                Write-Log "    BITS Jobs will not be removed because KeepBITSJobs is true." -WhatIfMode
            }
            else {
                if ($WhatIf) {
                    Write-Log "    (What-If Mode) ALL BITS jobs will be removed since KeepBITSJobs is NOT specified." -WhatIfMode
                }
                else {
                    if ($total -gt 0) {
                        Write-Log "    Removing ALL jobs since KeepBITSJobs is NOT specified."
                        Remove-BITSJobs
                    }
                    else {
                        Write-Log "    There are no jobs to delete."
                    }
                }
            }
        }
    }
    
    Function Remove-BITSJobs {
    
        try {
            Stop-Service BITS
            Rename-Item "$($env:ALLUSERSPROFILE)\Microsoft\Network\Downloader" -NewName "Downloader.OLD.$([Guid]::NewGuid().Guid.Substring(0,8))"
            Start-Service BITS
            $script:serviceRestartRequired = $true
            Write-Log "    Removed ALL BITS Jobs successfully."
        } catch {
            Write-Log "    Failed to delete the BITS jobs."
            Write-Log "    If necessary, run 'bitsadmin /reset /allusers' command under SYSTEM account (using psexec.exe) to delete the BITS Jobs."
            Write-Log "    Additionally, you can delete these jobs by stopping BITS service, renaming %allusersprofile%\Microsoft\Network\Downloader folder, and starting BITS service."
        }
    }
    
    Function Restart-CcmExec {
    
        $DisplayName = "SMS Agent Host"
    
        Write-Host ""
        Write-Log "$DisplayName - Checking if service restart is required."
        if ($script:serviceRestartRequired) {
    
            if ($WhatIf) {
                Write-Log "    (What-If Mode) Service Restart will be required." -WhatIfMode
                if ($NotifyPullDP) {
                    Write-Log "    (What-If Mode) NotifyPullDP method will be executed." -WhatIfMode
                }
                else {
                    Write-Log "    (What-If Mode) NotifyPullDP method will NOT be executed because -NotifyPullDP switch was NOT used." -WhatIfMode
                }
                return
            }
    
            try {
                Write-Host ""
                Write-Log "### Restarting CCMEXEC service... ###"
                Restart-Service CcmExec
                Write-Log "### Success! ###"
            } catch {
                Write-Log "### ERROR! Restart CcmExec Manually in order to recreate BITS jobs for content transfer! ###"
            }
    
            if (-not $DeletePullDPNotifications -and $NotifyPullDP) {
                # Only do this if notifications were not deleted. If they were deleted, NotifyPullDP will not do anything.
                try {
                    Write-Host ""
                    Write-Log "### Invoking NotifyPullDP WMI method against the SMS_DistributionPoint class in $DPNamespace."
                    Invoke-WmiMethod -Namespace root\SCCMDP -Class SMS_DistributionPoint -Name NotifyPullDP | Out-Null
                    Write-Log "### Success! ###"
                } catch {
                    Write-Log "### ERROR! Failed to invoke NotifyPullDP method! You can use wbemtest or WMI Explorer to invoke the method manually. ###"
                }
            }
            else {
                if (-not $NotifyPullDP) {
                    Write-Log "### Skipped invoking NotifyPullDP WMI method because -NotifyPullDP was NOT specified" -IsWarning
                    Write-Log "### You can use wbemtest or WMI Explorer to invoke the method manually, if necessary. ###"
                }
    
                if ($DeletePullDPNotifications) {
                    Write-Log "### Skipped invoking NotifyPullDP WMI method because -DeletePullDPNotifications was specified" -IsWarning
                    Write-Log "### Executing NotifyPullDP when there are no notifications does not do anything." -IsWarning
                }
    
            }
        }
        else {
            Write-Log "    Service Restart is NOT required. " -WhatIfMode
            if ($NotifyPullDP) {
                Write-Log "    NotifyPullDP method skipped. " -WhatIfMode
            }
        }
    }
    
    Write-Host ""
    Write-Log "### Script Started ###"
    $script:serviceRestartRequired = $false
    
    if ($WhatIf) {
        Write-Host ""
        Write-Log "*** Running in What-If Mode" -WhatIfMode
    }
    
    $DPNamespace = "root\SCCMDP"
    $DTSNamespace = "root\CCM\DataTransferService"
    
    Delete-WmiInstances -Namespace $DTSNamespace -ClassName "CCM_DTS_JobEx" -Filter "NotifyEndpoint like '%PullDP%'" -Property1 "ID"
    Delete-WmiInstances -Namespace $DTSNamespace -ClassName "CCM_DTS_JobItemEx" -Property1 "JobID"
    Delete-WmiInstances -Namespace $DPNamespace -ClassName "SMS_PullDPState" -Property1 "PackageID" -Property2 "PackageVersion" -Property3 "PackageState"
    Delete-WmiInstances -Namespace $DPNamespace -ClassName "SMS_PullDPContentState" -Property1 "PackageKey" -Property2 "ContentId" -Property3 "ContentState"
    
    if ($DeletePullDPNotifications) {
        Delete-WmiInstances -Namespace $DPNamespace -ClassName "SMS_PullDPNotification" -Property1 "PackageID" -Property2 "PackageVersion"
    }
    else {
        Write-Host ""
        Write-Log "SMS_PullDPNotification - Connecting to WMI Class on $ComputerName"
    
        $temp = Get-WmiObject -ComputerName $ComputerName -Namespace $DPNamespace -Class "SMS_PullDPNotification" -ErrorVariable WmiError -ErrorAction SilentlyContinue
    
        if ($WmiError.Count -ne 0) {
            Write-Log "    SMS_PullDPNotification - Failed to connect. Error: $($WmiError[0].Exception.Message)" -IsErrorMessage
            $WmiError.Clear()
        }
        else {
            Write-Log "    Found $(($temp | Measure-Object).Count) instances."
            Write-Log "    Skipped because DeletePullDPNotifications switch was NOT used." -IsWarning
        }
    }
    
    if ($ComputerName -eq $env:COMPUTERNAME) {
        Check-BITSJobs
    }
    else {
        Write-Host ""
        Write-Log "BITS Jobs"
        Write-Log "    Skipped because script is running against a remote computer." -IsWarning
    }
    
    Restart-CcmExec
    
    Write-Host ""
    Write-Log "### Script Ended ###"
    Write-Host "### Check $LogFile for more details. ###" -ForegroundColor Cyan
    #if (-not $WhatIf -and $serviceRestartRequired) {Write-Log "### Please restart the WMI service (which also restarts CcmExec). ###" -IsWarning}
    Write-Host ""
    
  • 內容顯示 已安裝 在提取 DP 上,但提取 DP 的 URL 和 URLSubPath 並未填入 ContentDPMap,這會導致啟用 SMB 存取的套件發生問題。

    當提取 DP 成功安裝內容時,它會傳送狀態消息,其中包含更新 URL/URLSubPathContentDPMap值所需的數據。 這會在處理提取 DP 回應時發生。 檢閱 散發套件以提取 DP 中的步驟 16-22,以瞭解流程並檢閱相關的記錄,以調查為何未處理狀態消息。 此問題的最可能原因是管理點上的 狀態消息 \MP\outboxes\StateMsg.box 待辦專案,或 MPFDM 因為許可權問題而無法將檔案複製到站臺伺服器。

內容庫中遺漏的內容檔案

有時候您會注意到內容庫中遺漏的內容。 這可能是因為先前的內容發佈問題,或有人/某事不小心從內容庫中刪除檔案所造成。 若要確認內容庫中遺漏內容,請識別受影響的套件,並追蹤從 PkgLibFileLib的套件內容。

確認內容庫中缺少套件的必要內容之後,請參閱將 封裝的壓縮複本重新傳送至網站 ,以取得如何重新填入內容的相關信息。

一般問題

  • DistMgr 或 PkgXferMgr 記錄會顯示找不到檔案/路徑的錯誤:

    SMS_PACKAGE_TRANSFER_MANAGER 3776 (0xec0) CContentDefinition::TotalFileSizes failed; 0x80070003
    SMS_PACKAGE_TRANSFER_MANAGER 3776 (0xec0) Sending content 000f8a0a-825c-457b-a15b-57ade145a09b for package \<PackageID>
    SMS_PACKAGE_TRANSFER_MANAGER 3776 (0xec0) CSendFileAction::SendFiles failed; 0x80070003
    SMS_PACKAGE_TRANSFER_MANAGER 3776 (0xec0) CSendFileAction::SendContent failed; 0x80070003
    SMS_PACKAGE_TRANSFER_MANAGER 648 (0x288) Sent status to the distribution manager for pkg <PackageID>, version 14, status 4 and distribution point ["Display=\\DPNAME.CONTOSO.COM\"]MSWNET:["SMS_SITE=S01"]\\DPNAME.CONTOSO.COM\~
    

    SMS_PACKAGE_TRANSFER_MANAGER 11228 (0x2bdc) Sending legacy content P0100053.2 for package <PackageID>  
    SMS_PACKAGE_TRANSFER_MANAGER 11228 (0x2bdc) CContentDefinition::TotalFileSizes failed; 0x80070003  
    SMS_PACKAGE_TRANSFER_MANAGER 11228 (0x2bdc) CSendFileAction::SendFiles failed; 0x80070003
    

    常見的錯誤碼: 0x800700020x80070003

    如果是找不到檔案/路徑的錯誤,問題可能是因為月臺伺服器上的內容庫遺失套件的內容檔案。 因此,PkgXferMgr 無法將檔案傳送至 DP。

    在這些情況下,您可以從記錄檔中識別內容識別碼,並追蹤 中 PkgLib 的內容, FileLib 以確保檔案存在。 您也可以使用內容庫總管來檢查套件內容檔案是否可在內容庫中使用,不過內容庫總管可能需要一些時間來載入,而且手動追蹤從 PkgLibFileLib的內容可能比較容易。 或者,您可以擷取 行程監視器 追蹤,以確認月臺伺服器上的內容庫中是否遺漏必要的檔案。

    如果內容庫中缺少內容的網站是套件來源網站,則必須更新套件以遞增套件 來源 版本,以便 DistMgr 再次從套件來源目錄擷取內容的快照集,然後重新填入遺漏的內容。

    如果缺少內容庫內容的網站與套件來源網站不同,您可以強制套件來源月臺將封裝的壓縮複本重新傳送至受影響的網站。 如需詳細資訊,請參閱 將封裝的壓縮複本重新傳送至網站

  • DistMgr/PkgXferMgr 記錄會顯示網路錯誤:

    SMS_DISTRIBUTION_MANAGER 5112 (0x13f8) Failed to make a network connection to \\DPNAME.CONTOSO.COM\ADMIN$ (0x35).~  
    SMS_DISTRIBUTION_MANAGER 5112 (0x13f8) ~Cannot establish connection to ["Display=\\DPNAME.CONTOSO.COM\"]MSWNET:["SMS_SITE=PS1"]\\DPNAME.CONTOSO.COM\. Error = 53
    SMS_DISTRIBUTION_MANAGER 5112 (0x13f8) Error occurred. Performing error cleanup prior to returning.
    

    常見的錯誤碼: 235364

    針對網路相關錯誤,請檢閱記錄檔,並識別您在收到錯誤時嘗試與之通訊的伺服器。 識別之後,請測試下列專案:

    1. 您可以使用 FQDN/NetBIOS/IP 位址偵測受影響的 SERVERNAME 嗎?
    2. 您可以從月台伺服器使用 SYSTEM 帳戶,使用 FQDN/NetBIOS/IP 位址存取 \\SERVERNAME\admin$ 共用嗎?
    3. 您可以使用從月台伺服器登入的用戶帳戶,使用 FQDN/NetBIOS/IP 位址來存取 \\SERVERNAME\admin$ 共用嗎?
    4. 月臺伺服器與受影響的伺服器之間是否有防火牆? RPC/SMB (相關埠是否) 開啟?

    如果上述測試成功,請從月台伺服器擷取 網路追蹤 (,以及受影響的伺服器) ,同時重現錯誤以供檢閱。

  • DistMgr/PkgXferMgr 記錄會顯示拒絕存取錯誤:

    SMS_DISTRIBUTION_MANAGER    7076 (0x1ba4)    Taking package snapshot for package <PackageID> from source \\PS1SITE\PKGSOURCE\DummyPackage
    SMS_DISTRIBUTION_MANAGER    7076 (0x1ba4)    ~The source directory \\PS1SITE\PKGSOURCE\DummyPackage doesn't exist or the SMS service cannot access it, Win32 last error = 5
    SMS_DISTRIBUTION_MANAGER    7076 (0x1ba4)    ~Failed to take snapshot of package <PackageID>
    

    常見的錯誤碼: 50x80070005

    如需許可權相關錯誤,請檢閱記錄檔,並識別您在收到錯誤時嘗試存取的路徑。 識別之後,請測試下列專案:

    1. 如果路徑是 UNC 路徑,您可以 Ping 受影響的 SERVERNAME 嗎?
    2. 站台伺服器電腦帳戶是否有存取路徑的許可權?
    3. 從月台伺服器使用 SYSTEM 帳戶時,是否可以使用 FQDN/NetBIOS/IP 位址存取受影響的路徑?
    4. 使用從月台伺服器登入的用戶帳戶時,是否可以使用 FQDN/NetBIOS/IP 位址存取受影響的路徑?
    5. 月臺伺服器與受影響的伺服器之間是否有防火牆? RPC/SMB (相關埠是否) 開啟?

    如果上述測試成功,請從月臺伺服器擷取 進程監視器 追蹤,同時重現錯誤以供檢閱。

  • DistMgr/PkgXferMgr 會尋找目錄中 \bin\x64\FileLib 的內容,而不是實際的內容庫位置。

    這是因為內容庫傳輸工具中的已知問題。