Active Directory reset adminCount back to 0

Active Directory reset adminCount back to 0

Introduction

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

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *