Автоматическая очистка базы WSUS
20 апреля 2016
Comments off
Скрипт из галереи на PowerShell для автоматической очистки базы и файлов WSUS
Этот скрипт можно запускать через планировщик задач.
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); $cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope; $cleanupScope.DeclineSupersededUpdates = $true $cleanupScope.DeclineExpiredUpdates = $true $cleanupScope.CleanupObsoleteUpdates = $true $cleanupScope.CompressUpdates = $true $cleanupScope.CleanupObsoleteComputers = $true $cleanupScope.CleanupUnneededContentFiles = $true $cleanupManager = $wsus.GetCleanupManager(); $cleanupManager.PerformCleanup($cleanupScope); |
Опции:
DeclineSupersededUpdates — Отклонить земененные обновления.
DeclineExpiredUpdates — Отклонить просроченые обновления.
CleanupObsoleteUpdates — Удалить из базы неиспользуемые обновления.
CompressUpdates — Удалить из базы устаревшие ревизии обновлений.
CleanupObsoleteComputers — удалить компьютеры которые не соединялись за последние 30 дней.
CleanupUnneededContentFiles — Удаляет файлы отклоненных обновлений из папки WSUS.
Свежие комментарии