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.
What command is used to stop a service in PowerShell?
If we want to change the address in PowerShell, what command can be used?
If we have trouble reading commands in Help, what is the solution?
If you have trouble reading commands in _Help using PowerShell, you can use the -Example parameter.
What command in PowerShell equals Get-Help?
The Man command can be used instead of the -Help command and get the required information in PowerShell.
If we want to increase the security of creating and executing scripts in PowerShell, what command will we use in it?
To be able to increase security when creating and executing scripts, we will use the Set-ExecutionPolicy command, the general command of which is as follows:
Set-ExecutePolicy -ExecutionPolicy Restricted