Hi Experts..
I wonder if you could assist me to polish off my script below.
The idea is to audit Cisco AMP AV software across all servers in the domain. My 1st draft works OK, and provides the version installed on each server, however it is missing some important info as follows:
1. Some servers may need powered off, or my account may not have rights to query some servers in the domain, therefore is it possible to capture the PSComputerName and errors created in the output CSV?
2. Some servers may not have the software installed at all. Is it possble to add ""PsComputerName - Software not found"" in the output for these servers?
Many thanks for any tips, assistance. cheers String
My script so far:
$Output= @()
$DaysAgo=(Get-Date).AddDays(-30)
$servers = (Get-ADComputer -SearchBase "OU=Services,DC=AD,DC=ACME,DC=COM,DC=AU" -filter {(enabled -eq $True) -and (PwdLastSet -gt $DaysAgo) -and (LastLogonTimeSTamp -gt $DaysAgo)} | Where-Object {$_.DistinguishedName -notlike "*ou=Domain Controllers,*" -and $_.DistinguishedName -notlike "*ou=Non-Windows Servers,*" -and $_.DistinguishedName -notlike "*ou=Disabled Server Accounts,*" }).name
$sb = {Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*|
Where-Object {$_.Publisher -eq 'Cisco Systems, Inc.' }
}
Invoke-Command -ComputerName $servers -ScriptBlock $sb |
Select-Object PsComputerName, DisplayName, DisplayVersion, Publisher, InstallDate | format-table | export-csv "D:\temp\CiscoAMP-Audit.csv" -NoTypeInformation
ASKER
String