Home » PowerShell » How to Remove a User from a Local Group in Command Prompt

How to Remove a User from a Local Group in Command Prompt

To remove a user from a local group, use the `net localgroup` in the command prompt. This command removes a user from the group name specified.

To remove a user from a local admin group in the cmd, follow the below steps:

  1. Open Command Prompt – Launch cmd with “Run as administrator”
  2. Type net localgroup groupname username /delete
  3. Press Enter
net localgroup "administrators" Don /delete

In the above command, the net localgroup command removes the user “Don” from the “administrators” group. It uses /delete to remove a user from a local admin group “administrators“.

The output of the above command after removing a user from a local admin group in the command prompt is given below.

Remove user from local admin group in cmd
Remove user from local admin group in cmd

To check if the user is successfully deleted from the local admin group, you can use the command to get all the users in the local admin group.

net localgroup "administrators"

The above command displays a list of all available users in the local admin group.

Conclusion

I hope the above article on how to remove a user from a local admin group in the command prompt is helpful to you.

You can also remove a user from the local admin group using the PowerShell Remove-LocalUser command.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.