Ok, I am trying to get a list off all Office versions and how many of each. We are migrating to Windows 10 and I am trying to talk him into upgrading office to 2016. We have Office as old as 2010. I need a list of how many of each version we have. Even if i can get a list of what computer has what version. I am trying not to run an audit on every computer individually, we have 200 computers.
I have tried several different approaches.
Get-ADComputer -Filter * -Property * | Select-Object Name |
Export-CSV ADcomputerslist.csv -NoTypeInformation -Encoding UTF8
This doesnt actually save to a file
foreach ($computer in (Get-Content "c:\computers.txt")){
Write-Verbose "Working on $computer..." -Verbose
Invoke-Command -ComputerName "$Computer" -ScriptBlock {
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\O365ProPlusRetail* |
Select-Object DisplayName, DisplayVersion, Publisher
} | export-csv C:\results.csv -Append -NoTypeInformation
}