从远程服务器访问角色和功能。
我尝试使用以下PowerShell脚本从远程服务器获取角色和功能。
Get-WmiObject -Computer "serverName“-query 'select * from Win32_ServerFeature‘
但问题是我无法识别额外的细节,比如集合中给定的对象是Feature还是role。有什么需要帮忙的吗?
发布于 2019-03-20 23:54:38
最后,我通过使用Get-WindowsFeature -ComputerName
找到了另一个替代方案,在这个方案中,我可以过滤featuretype
,并为远程机器的角色和功能获得单独的结果。
例如:
Get-WindowsFeature -ComputerName $ServerName | Where-Object {($_.InstallState -eq “installed”) -and ($_.FeatureType -eq “Role Service”)}
https://stackoverflow.com/questions/55119991
复制相似问题