【问题标题】:Pull a list of certain OS from AD [duplicate]从 AD 中提取某些操作系统的列表 [重复]
【发布时间】:2017-05-17 23:16:31
【问题描述】:

首先我是使用 PowerShell 的新手,所以如果这看起来有点简单,我深表歉意。 我正在尝试在我的环境中获取 2003 台服务器的清单。
到目前为止,这就是我所拥有的:

Get-ADComputer -Filter *2003* -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack

我收到语法错误。解析似乎挂在 Filter 属性上。如何在我的环境中只显示 2003 服务器?

谢谢。

【问题讨论】:

标签: powershell


【解决方案1】:

很抱歉重复请求。这是我的最终代码:

Get-ADComputer -Filter {(OperatingSystem -like "*windows*server*2003*") -and (Enabled -eq "True")} -Properties * | Sort Name | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion

感谢您的帮助。

【讨论】:

    猜你喜欢
    • 2018-11-22
    • 1970-01-01
    • 2011-09-26
    • 1970-01-01
    • 1970-01-01
    • 2021-08-23
    • 2011-07-08
    • 2015-08-24
    • 2012-09-11
    相关资源
    最近更新 更多