我有一个包含所有服务器名称的txt文件。
我想查询txt中的每个服务器,看看是否安装了RDS。到目前为止还不错。但是导出需要有servername和已安装的角色。如何将servername传递给输出文件。目前,它正在查询,但只有安装。因此,对于一个100台服务器,谁能真正地判断哪个服务器安装了它,以及哪个doesnt>>>> PLEase帮助?
Import-Module ServerManager
Get-Content W:\AllWindows.txt | ForEach-Object {Get-WindowsFeature -Name Remote-Desktop-Services} | Format-Table -Auto -wrap | Out-File -FilePath $csvfile发布于 2015-02-25 01:37:18
试着做这样的事情:
Get-Content W:\AllWindows.txt | ForEach-Object { @(($_), (Get-WindowsFeature -Name Remote-Desktop-Services)) } | Format-Table -Auto -wrap | Out-File -FilePath $csvfile发布于 2015-03-04 01:21:41
我已经想好了:
Get-Content W:\windows2012.csv | Foreach-Object {{Get-WindowsFeature | where-object {$_.Installed -eq $True} | Export-Csv -Path "W:\output\$_.txt"}https://stackoverflow.com/questions/28709500
复制相似问题