Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Remove local admins

Hi All, I'm looking to remove certain local admins from certain computers. Currently, I use the script below from PowerShell, but I'm looking to use PDQ to remove. It's only certain users that I'm looking to remove

Any suggestions welcome.

Many thanks

\server\PSTools\PsExec.exe \computer net localgroup Administrators Jim /delete

0

Comments

5 comments
Date Votes
  • You have the solution directly in front of you.

    enter image description here

    Put in all unwanted local admin names in a cmd step and run this deployment against all workstations

    PS: don't be confused, your spelling "administrators" is right for your script, my spelling "administratoren" it's the german version.

    -1
  • Is there a way to remove computer accounts also. Many thanks

    0
  • Sorry, i don't understand what do you mean with "computer accounts" in this case

    Example?

    0
  • Hi see attached

    enter image description here

    0
  • All i see is a local user account called "admin.local"

    You can remove him with:

    net localgroup Administrators admin.local /delete

    0