企业计算机管理与服务器管理指南
1. 企业计算机管理
在企业计算机管理中,我们可以利用 PowerShell 和 WMI (Windows Management Instrumentation)来完成多种任务,以下是一些常见操作的介绍。
1.1 检测热修复是否安装
可以使用 Test-HotfixInstallation 脚本来确定特定系统上是否安装了热修复。示例代码如下:
param(
$hotfix = $(throw "Please specify a hotfix ID"),
$computer = "."
)
## Create the WMI query to determine if the hotfix is installed
$filter = "HotFixID='$hotfix'"
$results = Get-WmiObject Win32_QuickfixEngineering `
-Filter $filter -Computer $computer
## Return the results as a boolean, which tells us if the hotfix is installed
[bool] $results
使用示例:
PS >Test-HotfixInstallation KB925228 LEE-DESK
True
PS >Test-Hot
超级会员免费看
订阅专栏 解锁全文
2926

被折叠的 条评论
为什么被折叠?



