惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
罗磊的独立博客
SecWiki News
SecWiki News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
IT之家
IT之家
博客园 - 聂微东
T
The Exploit Database - CXSecurity.com
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Vercel News
Vercel News
G
GRAHAM CLULEY
D
DataBreaches.Net
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
SegmentFault 最新的问题
博客园_首页
雷峰网
雷峰网
T
Tenable Blog
Spread Privacy
Spread Privacy
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
V
Visual Studio Blog
J
Java Code Geeks
博客园 - Franky
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
C
CERT Recently Published Vulnerability Notes
T
Threatpost
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
Recent Announcements
Recent Announcements
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
U
Unit 42
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
K
Kaspersky official blog
有赞技术团队
有赞技术团队
B
Blog
腾讯CDC

博客园 - DiryBoy

修复运行 tasklist 命令时提示 ERROR: Not found 删除坏掉的 Active Directory Domain 为 Exchange 服务器编写自定义的反垃圾插件 Windows 10 下安装 npm 后全局 node_modules 和 npm-cache 文件夹的设置 在 Win10 命令行使用 Consolas + 微软雅黑 Setting up SSL for SCM-Manager with Microsoft CA and TortoiseHg Installing SCM-Manager Win 7 装 SQL Server 2008 后使用 Asp.Net 需要进行的一些配置 为 IE8 写一个转跳加速器 WPF 实现已绑定集合项目的移除时动画过渡 成功在 Win 7 下用 VirtualBox 装 Win 7,分享一些经验 如何写递归的 Lambda 表达式 使用动态生成的委托提高调用动态程序集的性能 在 Azure 中部署支持 MVC 的 Asp.Net 应用程序 DIY 自己的多点触摸系统 未来就在眼前 用 C# 实现的前缀树 - Trie 自己改造 VSPaste 插件 用C# 写的龙贝格(Romberg)积分法
为 WSUS 服务器定期运行清理向导
DiryBoy · 2016-09-08 · via 博客园 - DiryBoy

在 WSUS 的管理界面的 Options 里面,可以找到 Server Cleanup Wizard 然后运行。后来想了一下,为什么不把它弄成定期运行呢!

找了一下,从 Windows Server 2012 开始,这个向导可以通过 PowerShell 执行,具体命令是 Invoke-WsusServerCleanup,它的参数主要有这么几个:

  1. -CleanupObsoleteComputers
          从数据库中删除长时间不报告状态的机器
  2. -CleanupObsoleteUpdates
          从数据库中删除过时的更新
  3. -CleanupUnneededContentFiles
          从硬盘中删除不需要的更新包
  4. -CompressUpdates
          从数据库中删除相同更新的旧版
  5. -DeclineExpiredUpdates
          拒掉已经过期的更新
  6. -DeclineSupersededUpdates
          拒掉被替代的更新

还有一个是 -UpdateServer,可以指定要运行清理向导的服务器,具体 Server 可以通过 Get-WsusServer 获得。在本机运行不需要这个参数。

那么剩下的事情就是创建一个计划任务,然后运行这个命令了。目前在计划任务貌似不能直接运行 PowerShell 脚本,所以需要曲线救国:

  1. 创建一个 .ps1 文件,并在里面写好 PowerShell 脚本
  2. 在计划任务那个运行命令里面写 powershell -file "path\to\your.ps1"

搞定。