Windows Powershell is a powerful tool from Microsoft, it can give you more performance than you think, and when you use this powerful tool, you can see the wide difference between it and Command Prompt. In this article, we want to be with you by creating a group in Windows with PowerShell, so that you can use it if you need to create a group.
In a general sense, a group will only include a number of users who have the ability to set different access to it.
This tutorial is based on PowerShell version 5.1 and above, which is installed by default on Windows 10 and Windows Server 2016 and above. To use this command in older versions, you must add the relevant module to the PowerShell or use the Command Prompt command to create a group.
How to create a group in Windows with PowerShell
There are various reasons for creating a user and group in the operating system, the most important of which is their right to access files, folders, etc. There are several ways to determine the right of access that we will not cover in this article, but the point to consider is that you have a number of users on your system and you need to set their access rights equally. It is in this state that the group finds meaning. Follow us by creating a group in Windows by PowerShell:
1- First, open PowerShell with Administrator access.
2- New-LocalGroup command is used to create a group in PowerShell.
The structure of this command is generally as follows.
New-LocalGroup –Name “GroupName” [Option]
The command to create a group in PowerShell, like the command to create a user, does not consist of different parameters and has only a few simple parameters, which will be used in the following example to get to know them better.
Example of creating a group with a PowerShell command
New-LocalGroup –Name “Accountant” - Description “Accountant Dept”
In the above command, a group called Accountant is created and its description is Accountant Dept.
You can easily create a group in PowerShell.
In this article, we tried to teach you how to create a group in Windows with PowerShell. An example was also taught to make you more familiar.