Ich habe ein paar hundert Maschinen, die verschiedene Versionen von MS Office ausgeführt werden. Ich muss herausfinden, welche Maschinen welche Versionen ausführen. Ich habe ein Powershell-Skript, ich bin in der Lage, die Namen der Maschinen zu erhalten und zu exportieren, die MS Office in einer CSV-Datei installiert haben, aber ich habe Probleme, die Office-Version auf den Maschinen zu installieren, um auch in den CSV zu exportieren. Der Code I bin mit unten aufgeführt:Ich habe ein wenig Probleme in PowerShell
$Computers = Get-Content "\\networkpath\ComputerList.txt"
$csvFilePath = "\\networkpath\SoftwareList.csv"
if (!(Test-Path -path $csvFilePath)) { ""|select name,version | Export-Csv -Path $csvFilePath -NoTypeInformation}
$outputArray = New-Object -TypeName System.Collections.ArrayList
ForEach ($Computer in $Computers)
{
Get-WmiObject -computerName $computer -Class CIM_Product -Filter 'Name like "%Microsoft Office Professional Plus%"' | select name
$Version = select name
$row = ""|select name,version
$row.Name = $Computer.ToString()
$row.Version = $Version.ToString()
$outputArray.Add($row)
}
$outputArray | Export-Csv -Path $csvFilePath -NoTypeInformation #-Append
Vielen Dank für die Informationen. – Jason