Import-Module ActiveDirectory
Get-ADUser -server dc01 -Filter * -Property sIDHistory | Select-Object name, sIDHistory
Get-ADGroup -server dc01 -Filter * -Property sIDHistory | Select-Object name, sIDHistory -ExpandProperty sidHistory | Format-Table name, Value –AutoSize