![命令行修改本地组策略](https://i-blog.csdnimg.cn/blog_migrate/56639e05dad66a3f352854b85ad6e1ba.png)
命令行修改本地组策略
Modern operating systems like Linux, Windows uses groups to manage user rights more flexible way. Users generally assigned to the groups to use groups related privileges like Local Admin
, Remote Desktop User
, Power User
, etc. In this tutorial we will look how manage manage local user groups in Windows operating systems.
像Linux这样的现代操作系统,Windows使用组来更灵活地管理用户权限。 通常分配给这些组的用户可以使用与组相关的特权,例如Local Admin
, Remote Desktop User
, Power User
等等。在本教程中,我们将研究如何在Windows操作系统中通过Manage管理本地用户组。
帮帮我 (Help)
Help and syntax information about local groups can be printed with the following command.
可以使用以下命令来打印有关本地组的帮助和语法信息。
$ net localgroup /?
![Help localgroup](https://i-blog.csdnimg.cn/blog_migrate/d05e8ca48d6624c3c2cb362a24e01b8c.png)
清单群组 (List Groups)
Local groups can be listed with net localgroup
command. This will list local groups not domain groups.
可以使用net localgroup
命令列出本地组。 这将列出本地组而不是域组。
$ net localgroup
![List Groups](https://i-blog.csdnimg.cn/blog_migrate/41ba0b1d80031e7a7a0e409d91a7474b.png)
As we can see groups are listed line by line. These groups are default groups those came with Windows Operating System.
如我们所见,组是逐行列出的。 这些组是Windows操作系统随附的默认组。
Administrators
is most privileged groups used for administrationAdministrators
是用于Administrators
的最特权组Users
is least privileged user used for normal users.Users
是用于普通用户的最低特权用户。
创建组 (Create Group)
Windows local groups can be create with /ADD
option easily. We will create a local group named Developers
in this example.
Windows本地组可以使用/ADD
选项轻松创建。 在此示例中,我们将创建一个名为Developers
的本地组。
$ net localgroup Developers /ADD
![Create Group](https://i-blog.csdnimg.cn/blog_migrate/1787eb490abe36c3d9da06bd15769037.png)
We get the message of successful group creation.
我们收到成功创建群组的信息。
删除群组 (Delete Group)
Local groups can be removed if we have no need for them. We will use /DELETE
option to remove group.
如果我们不需要本地组,则可以将其删除。 我们将使用/DELETE
选项删除组。
$ net localgroup Developers /DELETE
列出组用户 (List Group Users)
One of the most used option is listing given group users. We need to provides the local group name for its users. In this example we will list local group named Administrators
users.
最常用的选项之一是列出给定的组用户。 我们需要为其用户提供本地组名称。 在此示例中,我们将列出名为Administrators
users的本地组。
$ net localgroup "Administrators"
![List Group Users](https://i-blog.csdnimg.cn/blog_migrate/aba3f23fe4cd8705eeb020ac31e92b38.png)
As we can see the local groups alias and comment about the group is printed too. Administrators local group have two users named Administrator
and ismail
. Do not confuse user Administrator
with the local group Administrators
they are different entities.
如我们所见,本地组别名和关于组的评论也被打印出来。 管理员本地组有两个名为Administrator
和ismail
用户。 不要将用户Administrator
与本地组Administrators
混淆,它们是不同的实体。
将用户添加到组(Add User To A Group)
We can add existing user to the local group by providing the user named and /ADD
option. In this example we will add user ismail
to the Developers
group. So user ismail will use all resources and privileges provided by Developers
group.
我们可以通过提供用户名称和/ADD
选项将现有用户添加到本地组。 在此示例中,我们将用户ismail
添加到Developers
组。 因此,用户ismail将使用Developers
组提供的所有资源和特权。
$ net localgroup Developers ismail /ADD
在组中添加评论 (Add Comment To The Group)
In busy environment we will manage lot of builtin and administrator created groups. We need some clues about these local groups to remember. Or we can set some notes like when we will delete these groups. All these information can be stored in comments about group. We will set some note about Developers
group.
在繁忙的环境中,我们将管理许多内置和管理员创建的组。 我们需要一些有关这些本地团体的线索来记住。 或者我们可以设置一些注释,例如何时删除这些组。 所有这些信息都可以存储在有关组的注释中。 我们将为Developers
组设置一些注释。
$ net localgroup Developers /COMMENT:"Only 10.1.0.0/24 network"
The comment can be viewer with GUI or while listing group members.
该评论可以是具有GUI的查看者,也可以是列出组成员的评论者。
翻译自: https://www.poftut.com/local-group-management-windows-command-line/
命令行修改本地组策略