Remove local admins
chris.jones2
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
You have the solution directly in front of you.
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.
Is there a way to remove computer accounts also. Many thanks
Sorry, i don't understand what do you mean with "computer accounts" in this case
Example?
Hi see attached
All i see is a local user account called "admin.local"
You can remove him with:
net localgroup Administrators admin.local /delete