Active Directory reset adminCount back to 0

Intro

The PS code below will find admin accounts in your Active Directory that have an adminCount higher than 0 and reset it back to 0, always verify why the count was increased!

Code

get-aduser -Filter {admincount -gt 0} -Properties adminCount | Set-Aduser -UserPrincipalName $_.UserPrincipalName -Replace @{adminCount=0}

Comments

Loading Comments...