Remove SID-History of a single user

Single User

Get-ADUser USERNAME -properties sidhistory | foreach {Set-ADUser $_ -remove @{sidhistory=$_.sidhistory.value}}

All Users within a OU with an SID History

Get-ADUser SearchBase “OU=Accounts,DC=mydomain,DC=com” -Filter {sidhistory -like “*”} -properties sidhistory | foreach {Set-ADUser $_ -remove @{sidhistory=$_.sidhistory.value}}

Leave a Reply

avatar
  Subscribe  
Notify of
We use cookies to improve the user-friendliness and stats of the website. Through your visit, you agree with that.