To identify the accounts, try this:
Get-ADUser -Filter * -Properties ntSecurityDescriptor |
Where-Object { $_.ntSecurityDescriptor.AreAccessRulesProtected }
To re-enable permission inheritance, you'd need to call SetAccessRuleProtection($false, $true) on each ntSecurityDescriptor object, and commit the changes back to the directory. Something like this (though I haven't tested this part):
Get-ADUser -Filter * -Properties ntSecurityDescriptor |
Where-Object { $_.ntSecurityDescriptor.AreAccessRulesProtected } |
ForEach-Object {
$_.ntSecurityDescriptor.SetAccessRuleProtection($false, $true)
$_ | Set-ADUser -Replace @{ntSecurityDescriptor = $_.ntSecurityDescriptor}
}