As an IT administrator, sometimes you are required to make a software inventory of member servers or computers which are the part of active directory. It’s difficult to extract the report individually from each system in a large Infrastructure. In the below Powershell script, You can extract the software inventory from all computers in specific OU, Similarly, you can specify the complete domain distinguished name like $OUpath = ‘DC=infoalias, DC=local’.
###Powershell script###
$Header = @”
<style>
TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}
TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black;}
</style>
“@
$OUpath = ‘OU=Servers,DC=infoalias,DC=local’
Get-ADComputer -Filter * -SearchBase $OUpath |
ForEach-Object {
Get-CimInstance -Class Win32_Product -computername $_.Name |
Where-Object {$_.Name} } | ConvertTo-Html -Property Name,caption,vendor,version,IdentifyingNumber,PSComputerName -Head $Header | Out-File -FilePath D:\ad_data_report\PSDrives.html