Script to Find installed software on a Domain
Hi All,
I found this script but this need to input list of computers in domain
Get-Content 'c:\computerlist.txt' | ForEach-Object { Get-WMIObject -ComputerName $_ -Query "SELECT * FROM win32_product WHERE name LIKE '%firefox%'" | Select-Object -Property $_,Name,InstallLocation,InstallDate | Export-CSV 'c:\computerqueryresults.csv'
But I found this half command connect to domain so need a help to get the report ?
Get-ADComputer -Filter * -SearchBase "OU=Computers,OU=myour,DC=domain,DC=com,DC=au" | ForEach-Object {$strComputerName = $_.Name;.....
AS
Answers (1)
here is the script to get all the computers:
$strCategory = "computer"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.Filter = ("(objectCategory=$strCategory)")
$colProplist = "name"
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}
$colResults = $objSearcher.FindAll()
foreach ($objResult in $colResults){
$objComputer = $objResult.Properties ; $objComputer.name
$objComputer.name | Out-File -append C:\computer.csv
}
Comments:
-
HI Mramsdell,
Is this PS script ? I can run it but nothing in the computer.csv ? I have replace "name" with my application name.
As - aussupport 10 years ago-
Yes this is a PS script. This is only to get the CSV of the computers. don't change the "name". That is a field that it is calling on the computer. - mramsdell 10 years ago
-
I only need the computer list that installed "Firefox" ? - aussupport 10 years ago