cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mickeyshowers
Engaged Sweeper III

I searched for an action to do this but I didn't find anything. Basically, I'm looking for a custom action that will remove the Last User from the local administrators group. Any ideas? Thanks!

14 REPLIES 14
scarsysadmin
Engaged Sweeper III
yup
warlock1663
Engaged Sweeper
Can this be done to remove multiple users from the local admin group?
scarsysadmin
Engaged Sweeper III
To add to this, I would do this through User Pages actions. The workflow would be click computer, click username of person to be removed, click "remove" action, voila.

action to be called by something like this:
powershell -noprofile -ExecutionPolicy bypass -file {actionpath}RemoveAdmin.ps1 -user {username} -domain {userdomain}

Then use that information to run the commands.
scarsysadmin
Engaged Sweeper III
I would recommend powershell. You could display the current admins and then prompt for a username to replace.

The actual command is
net localgroup administrators
net localgroup administrators /delete domain\user

Bart_E
Lansweeper Employee
Lansweeper Employee
You can write a VBscript that removes a user from the local administrator group and set it up as a custom action. Unfortunately, we can't provide support for custom script but we did find several examples online which could help you out if you perform a search for 'remove local admin rights users script'. Another option would be using the Lansweeper deployment feature to deploy certain scripts.