Advance

How to Create a group in Windows with PowerShell

How to Create a group in Windows with PowerShell

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.

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

    What command is used to stop a service in PowerShell?

    Reply
  • Alexander
    Alexander
    6 months ago

    If we want to change the address in PowerShell, what command can be used?

    Reply
  • Makayla
    Makayla
    6 months ago

    If we have trouble reading commands in Help, what is the solution?

    Reply
    • Dani
      Dani
      6 months ago

      If you have trouble reading commands in _Help using PowerShell, you can use the -Example parameter.

      Reply
  • Brianna
    Brianna
    6 months ago

    What command in PowerShell equals Get-Help?

    Reply
    • Dani
      Dani
      6 months ago

      The Man command can be used instead of the -Help command and get the required information in PowerShell.

      Reply
  • Madelyn
    Madelyn
    6 months ago

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

    Reply
    • Dani
      Dani
      6 months ago

      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

      Reply

Leave Your Comment

Your email address will not be published.

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

+18054214518

7 days a week, 24 hours a day