当前位置: 首页 > news >正文

查询电脑用户名和组信息

在命令行里查看电脑名:

c:\>hostname

在命令行里,查看组信息:

# 显示本地所有的用户组

c:\>net localgroup 

#显示administrators组包含的用户信息

c:\>net localgroup administrators

# 比如我的显示信息:

C:\>net localgroup administrators

Alias name     administrators

Comment

Members

-------------------------------------------------------------------------------

GLOBAL\ComputerAdmins

GLOBAL\MyEID

HONADMIN

The command completed successfully.

"net localgroup "命令用于管理 Windows 计算机上的本地组。下面是它的作用:

1. 显示信息: 在不带任何参数的情况下使用时,它会显示服务器名称和计算机上的本地组名称。

2. 添加或修改本地组:

    * 要添加新的本地组,可使用语法:net localgroup <GroupName> /add [/comment:"<Text>"] 。

    * 要删除现有本地组,请使用:net localgroup <GroupName> /delete。

3. 从本地组中添加或删除用户:

    * 要在本地组中添加用户或全局组,请使用:net localgroup <GroupName> /add <Name>。

    * 要从本地组中删除用户或组,请使用: net localgroup <GroupName> /delete <Name>。

4. 附加参数:

    * /comment:"<Text>": 为新组或现有组添加注释(最多 256 个字符)。

    * /domain: 在当前域的主域控制器上执行操作(否则在本地计算机上执行)。

5. 示例

    * 显示所有本地组: net localgroup

    * 显示特定组的用户账户: net localgroup <group_name>  

    * 添加名为 "Exec "的本地组: net localgroup exec /add

    * 将 "Exec "组添加到域用户账户数据库: net localgroup exec /add /domain

请记住,该命令适用于管理 Windows 系统中的本地组及其成员。

The ”net localgroup“ command is used to manage local groups on a Windows computer. Here’s what it does:

1. Displays Information: When used without any parameters, it displays the name of the server and the names of local groups on the computer.

2. Adds or Modifies Local Groups:

    * To add a new local group, you can use the syntax: net localgroup <GroupName> /add [/comment:"<Text>"].

    * To delete an existing local group, use: net localgroup <GroupName> /delete.

3. Adds or Removes Users from Local Groups:

    * To add a user or global group to a local group, use: net localgroup <GroupName> /add <Name>.

    * To remove a user or group from a local group, use: net localgroup <GroupName> /delete <Name>.

4. Additional Parameters:

    * /comment:"<Text>": Adds a comment for a new or existing group (up to 256 characters).

    * /domain: Performs the operation on the primary domain controller of the current domain (otherwise, it’s performed on the local computer).

5. Examples:

    * To display all local groups: net localgroup

    * To display the specific group's user account: net localgroup <group_name>  

    * To add a local group called “Exec”: net localgroup exec /add

    * To add the “Exec” group to the domain user accounts database: net localgroup exec /add /domain

Remember that this command is useful for managing local groups and their members on a Windows system.

当组策略修改后,可以直接在命令行里敲命令,强制更新组策略:

c:\>gpupdate /force

命令 "gpupdate /force "用于强制对所有组策略设置进行后台更新,无论这些设置是否已更改。该命令不考虑常规刷新间隔,强制重新应用每项新旧策略。当你需要确保无需等待正常更新周期就能应用所有策略时,该命令尤其有用。该命令既可在本地计算机上运行,也可远程启动强制组策略更新。

The command "gpupdate /force" is used to force a background update of all Group Policy settings, whether they have changed or not. This command disregards the regular refresh interval and forcefully reapplies every policy, new and old. It is especially useful when you need to ensure that all policies are applied without waiting for the normal update cycle. The command can be run both locally on a computer or remotely to initiate a forced Group Policy update.

http://www.lryc.cn/news/338136.html

相关文章:

  • 【Godot4.2】CanvasItem绘图函数全解析 - 9.绘制表格
  • 部署HDFS集群(完全分布式模式、hadoop用户控制集群、hadoop-3.3.4+安装包)
  • TCP协议简单总结
  • 【Qt 实现录音】
  • python:算法竞赛入门之一
  • 【大数据与云计算】虚拟机安装Linux
  • 从零开始编写一个cmake构建脚本
  • pringboot2集成swagger2出现guava的FluentIterable方法不存在
  • 进程线程的关系
  • 一些 VLP 下游任务的相关探索
  • 【opencv】示例-pca.cpp PCA图像重建演示
  • C语言中的编译和链接
  • 如何将三方库集成到hap包中——通过IDE集成cmak构建方式的C/C++三方库
  • Towards Street-Level Client-Independent IP Geolocation(2011年)(第二部分)
  • 软件测试过程和测试生命周期
  • python-study-day1
  • 【Apache2】彻底删除 Apache2 服务器
  • C#:成绩等级转换
  • 每日OJ题_01背包③_力扣494. 目标和(dp+滚动数组优化)
  • vue3+element plus图片预览点击按钮直接显示图片的预览形式
  • GAMS104 现代游戏引擎 2
  • spring boot学习第十七篇:OAuth2概述及使用GitHub登录第三方网站
  • 基于springboot的电影评论网站系统源码数据库
  • javaScript手写专题——实现instanceof/call/apply/bind/new的过程/继承方式
  • C++11 新特性:tuple 元组
  • 最齐全,最简单的免费SSL证书获取方法——实现HTTPS访问
  • c语言->贪吃蛇实战技巧结合EasyX简单实现页面管理(简单实现)
  • C语言-详解内存函数
  • 【核心完整复现】基于目标级联法的微网群多主体分布式优化调度
  • Mac下安装NVM,NVM安装Node(附带NPM)