共用方式為


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

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

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

範例問題

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

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

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

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

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

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

    針對提取 DP,提取 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:00AM 期間允許高優先順序 ]。 因此,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 實例計數。 您也可以檢閱提取 DP 上的 WMI 類別實例,以識別處於失敗狀態的ROOT\SCCMDP:SMS_PullDPState套件,並檢閱PullDP.log以及DataTransferService.log調查失敗

  • SignatureDownload 提取 DP 上的作業失敗,發生 HTTP 404 錯誤。

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

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

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

    • 轉散發套件(重新發佈套件不需要下載簽章,因為已下載完整內容)。
    • 將提取 DP 設定為使用月台伺服器上未共置的來源 DP。
  • 嘗試從來源 DP 下載內容時,DataTransferService.log會顯示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 個 (或更多) BITS 作業。 在此案例中,從提取 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
    

    常見的錯誤碼:0x80070002,0x80070003

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

    在這些情況下,您可以識別記錄中的內容標識符,並從 中追蹤內容 PkgLibFileLib 以確保檔案存在。 您也可以使用內容庫總管來檢查內容庫中是否有套件內容檔案,不過內容庫總管可能需要一些時間才能載入,而且從手動追蹤內容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.
    

    常見錯誤碼:2、3、5364

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

    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>
    

    常見的錯誤碼:5,0x80070005

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

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

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

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

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