是否可以从安装有特定软件的Active Directory中获取服务器列表? 例如,获取安装了wampserver版本5的所有服务器。
您可以仔细阅读现有的脚本https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteProgram-Get-list-de9fd2b4
要获取具有Internet Explorer 11的计算机的列表,请执行以下操作:
$result= @(); $programName = "Internet Explorer 11" $computers = ("Computer1","Computer2","Computer3") $computers | % { if ((Get-RemoteProgram -ComputerName $_).programname -contains $programName) { $result += $_}} $result
不,不像你问这个问题。 此信息不在Active Directory中,很抱歉地说。 然而,你可以写一些PowerShell,从Get-ADComputer开始,可能只需要一个filter来获得服务器操作系统,然后pipe道或循环到WMI或registry查询中,以获得已安装软件的列表 – 希望你想要的版本信息是由供应商在那里写的。
很简单 – 当然,你也可以使用像微软自己的SCCM这样的附加pipe理工具,或者为你做的第三方库存工具,有些甚至是免费的。 我特别喜欢SpiceWorks。
你可以试试把这个服务器列表放在文本文件上,或者从AD过滤掉
#$computer="get-content computers.txt" #computers=Get-ADComputer -Filter {OperatingSystem -Like “Windows Server*”} foreach ($Computers in $computer) { Get-WmiObject -query 'select * from win32_product' | where {$_.name -like "Ccleaner*"} |ft Name, Version,PsComputername | export-csv "$env:userprofile\desktop\software.csv" }