Remove local admins

0

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

Cancel
login to comment
1

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.

Cancel
login to comment

1

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

You can remove him with:

net localgroup Administrators admin.local /delete

Cancel
login to comment

0

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

Cancel
login to comment

0

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

Example?

Cancel
login to comment

0

Hi see attached

enter image description here

Cancel
login to comment

Reply