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:
- Open Command Prompt – Launch cmd with “Run as administrator”
- Type net localgroup groupname username /delete
- 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.
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.