Computer >> Computer tutorials >  >> System >> windows

Open and Manage Local User and Group Management in Windows Home using Command Prompt or PowerShell

Windows 11/10 offers a program — lusrmgr.msc or Local User and Group Management — which allows an administrator to manage local users and groups on the computer. However, the snap-in service is not available for Windows 11 Home or Windows 10 Home users. So if you want to access local user and group Management in Windows 11/10 Home, then you will have to try some alternatives. These alternatives may not be users friendly but they work.

Open & Manage Local User and Group Management

Windows 11/10 Pro, Enterprise, etc. versions offer programs like lusrmgr.msc, Netplwiz, and even userpasswords2 programs that allow managing users and groups.

Windows 11/10Home users with admin privileges can use Command Line Interfaces such as NET LOCALGROUP and Microsoft.PowerShell.LocalAccounts to do the same thing.

Open and Manage Local User and Group Management in Windows Home using Command Prompt or PowerShell

How to use Net LocalGroup

Here is the complete syntax for this command which you can run over elevated Command Prompt

NET LOCALGROUP 
[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]

When you run only “Net Localgroup” it will list all the groups in the Windows 10 PC.

1] Add a user with and without domain

net localgroup <group_name> UserLoginName /add
net localgroup users domainname\<username> /add

2] Create a new group

net localgroup <groupname> /add

3] List all users in a group

net localgroup <groupname>

4] Remove a user from a group

net localgroup <groupname> <username> /delete

5] Delete a user from a group

net localgroup <groupname> /delete

PowerShell LocalAccounts Module

Open and Manage Local User and Group Management in Windows Home using Command Prompt or PowerShell

PowerShell offers a LocalAccount module which provides 15 cmdlets to manage Windows Users, and Groups. Here is the list:

  • Add-LocalGroupMember — Add a user to the local group
  • Disable-LocalUser —Disable a local user account
  • Enable-LocalUser — Enable a local user account
  • Get-LocalGroup — View local group preferences
  • Get-LocalGroupMember — View the list of all local group members
  • Get-LocalUser — View a local user account’s preferences
  • New-LocalGroup — Create a new local group
  • New-LocalUser — Create a new local user account
  • Remove-LocalGroup — Remove a local group
  • Remove-LocalGroupMember — Remove a member from a local group
  • Remove-LocalUser — Remove a local user account
  • Rename-LocalGroup — Rename a local group
  • Rename-LocalUser — Rename a local user account
  • Set-LocalGroup — Change the settings of a local group
  • Set-LocalUser — Change the account settings of a local user

So if you want to create a new local group, execute the following command

New-LocalGroup -Name "TWC"

To remove a member from a group, run this command:

Add-LocalGroupMember -Group 'TWC' –Member 'ashis'

Using both NET LOCALGROUP and Microsoft.PowerShell.LocalAccounts interface, you can manage users and groups easily. These commands are easy to use, but if you want a software-based approach, then try the Lusrmgr tool.

Open and Manage Local User and Group Management in Windows Home using Command Prompt or PowerShell