The following script will summarise the ExtentionAttributes in use within an Active Directory Domain.
This script uses the ActiveDirectory CMDlets included in the Active Directory Module for PowerShell, this is part of the Remote Server Administrative Tools (RSAT) pack available from Microsoft for client OSs.
Note that once RSAT has been installed, you will need to enable the Active Directory Module for PowerShell feature via Add and Remove Programs.
Import-Module ActiveDirectory
$attributeName = "SAMAccountName",
"extensionattribute1",
"extensionattribute2",
"extensionattribute3",
"extensionattribute4",
"extensionattribute5",
"extensionattribute6",
"extensionattribute7",
"extensionattribute8",
"extensionattribute9",
"extensionattribute10",
"extensionattribute11",
"extensionattribute12",
"extensionattribute13",
"extensionattribute14",
"extensionattribute15"
$summary = "" | select $attributeName
foreach($attribute in $attributeName){
$summary.$attribute = (Get-ADuser -filter {$attribute -like "*"} -Properties $attribute).count
}
$summary | fl