forked from hsmalley/Powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-OfficeCounts.ps1
15 lines (13 loc) · 1.03 KB
/
Get-OfficeCounts.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Add-PSSnapin Quest.ActiveRoles.ADManagement -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
$Cred = Get-Credential
$Computers = Get-QADComputer -SearchRoot "OU=Workstations,DC=DOMAIN,DC=LOCAL" -Credential $Cred
$Computers | ForEach-Object {
$Computer = $_.name
$Office = C:\Users\Hsmalley\Get-InstalledApp.ps1 -ComputerName $Computer -AppName "Microsoft Office XP Standard*" | Select ComputerName,AppName
$Office | Export-Csv -Append -Path C:\Users\Hsmalley\Office.csv -NoTypeInformation
$Office = C:\Users\Hsmalley\Get-InstalledApp.ps1 -ComputerName $Computer -AppName "Microsoft Office XP Professional*" | Select ComputerName,AppName
$Office | Export-Csv -Append -Path C:\Users\Hsmalley\Office.csv -NoTypeInformation
$Office = C:\Users\Hsmalley\Get-InstalledApp.ps1 -ComputerName $Computer -AppName "Microsoft Office * 2010" | Select ComputerName,AppName
$Office | Export-Csv -Append -Path C:\Users\Hsmalley\Office.csv -NoTypeInformation
}
$Username = (Get-WMiObject -Class Win32_ComputerSystem -ComputerName $ComputerName).Username