Папка windows\temp забивается файлами cab_xxxx

Данная проблема вызвана сбоем службы автоматического обновления Windows, в частности при работе с серверами обновлений WSUS.

Пошаговое решение проблемы выглядит так:

  1. Остановка службы обновлений (wuauserv)
  2. Остановка службы trustedinstaller
  3. Удаление содержимого папки c:\windows\temp
  4. Удаление cab-файлов из папки c:\windows\logs\CBS
  5. Удаление папки  C:\windows\softwaredistribution
  6. Запуск сервиса trustedinstaller
  7. Запуск службы обновления

Для удаленного автоматического решения проблемы можно воспользоваться скриптом:

fix_winupdate_tmp_cab.ps1
 
$Machine = read-host "Type in the Computer Name"
$windowsUpdateService = 'wuauserv'
$trustedInstallerService = 'trustedinstaller'
function Set-ServiceState 
{
    [CmdletBinding()]
    param(
        [string]$ComputerName,
        [string]$ServiceName
    )
    Write-Verbose "Evaluating $ServiceName on $ComputerName."
    [string]$WaitForIt = ""
    [string]$Verb = ""
    [string]$Result = "FAILED"
    $svc = Get-Service -computername $ComputerName -name $ServiceName
    Switch ($svc.status) {
        'Stopped' {
            Write-Verbose "[$ServiceName] is currently Stopped. Starting."
            $Verb = "start"
            $WaitForIt = 'Running'
            $svc.Start()
        }
        'Running' {
            Write-Verbose "[$ServiceName] is Running. Stopping."
            $Verb = "stop"
            $WaitForIt = 'Stopped'
            $svc.Stop()
        }
        default {
            Write-Verbose "$ServiceName is $($svc.status). Taking no action."
        }
    }
    if ($WaitForIt -ne "") {
        Try { # For some reason, we cannot use -ErrorAction after the next statement:
            $svc.WaitForStatus($WaitForIt,'00:02:00')
        } Catch {
            Write-Warning "After waiting for 2 minutes, $ServiceName failed to $Verb."
        }
        $svc = (get-service -computername $ComputerName -name $ServiceName)
        if ($svc.status -eq $WaitForIt) {
            $Result = 'SUCCESS'
        }
        Write-Verbose "$Result - $ServiceName on $ComputerName is $($svc.status)"
        Write-Verbose ("{0} - {1} on {2} is {4}" -f $Result, $ServiceName, $ComputerName, $svc.status)
    }
}
# stop update service
Write-Host "stop update service"
Set-ServiceState -ComputerName $Machine -ServiceName $windowsUpdateService -Verbose
#removes temp files and renames software distribution folder
Write-Host "removes temp files and renames software distribution folder"
Remove-Item \\$Machine\c$\windows\temp\* -recurse
Rename-Item \\$Machine\c$\windows\SoftwareDistribution SoftwareDistribution.old
#restarts update service
Write-Host "restarts update service"
Set-ServiceState -ComputerName $Machine -ServiceName $windowsUpdateService
#removes software distribution.old
Write-Host "removes software distribution.old"
Remove-Item \\$Machine\c$\windows\SoftwareDistribution.old -recurse
#stops trustedinstaller service
Write-Host "stops trustedinstaller service"
Set-ServiceState -ComputerName $Machine -ServiceName $trustedInstallerService
#removes cab files from trustedinstaller
Write-Host "removes cab files from trustedinstaller"
remove-item \\$Machine\c$\windows\Logs\CBS\* -recurse
#restarts trustedinstaller service
Write-Host "restarts trustedinstaller service"
Set-ServiceState -ComputerName $Machine -ServiceName $trustedInstallerService
#rebuilds cab files from WSUS
Write-Host "rebuilds cab files from WSUS"
invoke-command -ComputerName $Machine -ScriptBlock { & cmd.exe "c:\windows\system32\wuauclt.exe /detectnow" }

Источник: https://community.spiceworks.com/topic/495234-windows-temp-file-is-full-of-cab_xxxx-files-on-windows-server-2008-r2

Поделиться:
Метки: , , , , , , , . Закладка Постоянная ссылка.
0 Комментарий
Oldest
Newest Most Voted
Inline Feedbacks
View all comments