Generic solution:
I think the Microsoft-centric solution to this is to license using volume keys, and then simply use your KMS server to report on license activation status.
Windows 7 and above-solution
If volume licensing is not an option, and all of your clients are Windows 7 or newer, you could just query the SoftwareLicensingProduct
WMI class on each machine to retrieve licensing details, here is an example using PowerShell and AD:
$Clients = Get-ADComputer -LDAPFilter "(&(operatingSystem=*Windows*))"
$LicenseQuery = "SELECT ApplicationID,Name,Description,ProductKeyID,PartialProductKey FROM SoftwareLicensingProduct WHERE LicenseStatus = 1"
foreach($Client in $Clients){
$ActiveLicenses = @(Get-WmiObject -Query $LicenseQuery -ComputerName $Client.Name)
if($ActiveLicense.Count -le 1){
Write-Warning "Unable to find active license for computer $($Client.Name)"
}
# Do what you want with the license information here
}
It will require a bit of error handling and output logic (you could export the details to a CSV file if you want), but this whould get you going in the right direction.
The attributes I've included in the query should be sufficient for an audit, but ask Microsoft if in doubt