Advance

How to Create a group in Windows with PowerShell

How to Create a group in Windows with PowerShell
1
(1)

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.

Recommended Article: PostgreSQL installation tutorial on Windows Server 2016

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.

Conclusion

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.

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

8 thoughts on “How to Create a group in Windows with PowerShell

  1. If we want to increase the security of creating and executing scripts in PowerShell, what command will we use in it?

    1. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day