如何在Windows-11中删除外部用户组别名?

问题描述 投票:0回答:1

背景
尝试将

Windows-11 Home
版本的语言设置从 ES 更改为 US。 我设法完成了大部分更改,但仍有其他几个项目*以西班牙语返回。

返回西班牙团体的一个例子:

Get-LocalGroup

Name                                 Description
----                                 -----------
Administradores                      Los administradores tienen acceso completo y sin
Device Owners                        Los miembros de este grupo pueden cambiar la …
Hyper-V Administrators               Members of this group have complete and unrestricted …
IIS_IUSRS                            Grupo integrado usado por Internet Information Services.
Invitados                            De forma predeterminada, los invitados tienen el mismo… 
...

进一步了解这些群组如何/为何使用西班牙语,我运行了

whoami /groups
net localgroup
。我得到以下输出,显示某些组在 Alias
 列下列为 
Type

# whoami /groups

Group Name                                                    Type             SID          Attributes
============================================================= ================ ============ ===============================================================
Everyone                                                      Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account and member of Administrators group Well-known group S-1-5-114    Mandatory group, Enabled by default, Enabled group
BUILTIN\Administradores                                       Alias            S-1-5-32-544 Mandatory group, Enabled by default, Enabled group, Group owner
BUILTIN\Usuarios                                              Alias            S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\INTERACTIVE                                      Well-known group S-1-5-4      Mandatory group, Enabled by default, Enabled group
CONSOLE LOGON                                                 Well-known group S-1-2-1      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users                              Well-known group S-1-5-11     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization                                Well-known group S-1-5-15     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account                                    Well-known group S-1-5-113    Mandatory group, Enabled by default, Enabled group
LOCAL                                                         Well-known group S-1-2-0      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication                              Well-known group S-1-5-64-10  Mandatory group, Enabled by default, Enabled group
Mandatory Label\High Mandatory Level                          Label            S-1-16-12288


# net localgroup

Aliases for \\LAPTOP-xxxx

------------------------------------------
*Administradores
*Device Owners
*Hyper-V Administrators
*IIS_IUSRS
*Invitados
*Lectores del registro de eventos
*System Managed Accounts Group
*Usuarios
*Usuarios COM distribuidos
*Usuarios de administración remota
*Usuarios del monitor de sistema
*Usuarios del registro de rendimiento

The command completed successfully.


问:如何删除这些群组别名并查看原来的群组名称?

Bonus Question
:
它会从这些相同的项目中删除 ES 语言吗?


相关问题:

windows user-interface active-directory account
1个回答
0
投票

net localgroup输出中的术语

alias
有点误导,因为它只是指组的name(您可以将其视为组的不变标识符的别名,即SID) )。

以下信息似乎是根据操作系统附带的 Windows 显示(用户界面)语言“静态”分配的: 内置

本地用户和组帐户的
    名称
  • ,例如Administrators(英语)/Administradores(西班牙语)。
    他们的
    描述
  • 因此,稍后
  • 更改 Windows 显示语言(通过安装
语言包

,如链接问题的此答案中所述)不会更改此信息,因此您唯一的选择是自己执行此操作 -请参阅下一节。 除了可以通过 lusrmgr.msc

交互地

重命名此类帐户并更新其描述之外,您还可以以编程方式

注意事项:

重命名用户和组帐户可能会破坏现有脚本

(除非它们碰巧使用 SID 而不是名称)。
  • 对于Windows来说,首先本地化这些名称是一个不幸的设计决定,正是因为它阻碍了代码在使用不同显示语言的机器之间的可移植性,或者就像您的情况一样,切换到不同的显示语言。

  • # Establish a mapping by SID for all built-in *groups* # to their English names and descriptions. # See below for how to create this hashtable programmatically. $sidMap_Groups = [ordered] @{ 'S-1-5-32-544' = [ordered] @{ Name = 'Administrators' Description = 'Administrators have complete and unrestricted access to the computer/domain' } # ... } # Ditto for built-in *users*, but with keys based on the # *last SID component* only. $sidMap_Users = [ordered] @{ '500' = [ordered]@{ Name = 'Administrator' Description = 'Built-in account for administering the computer/domain' } # ... } # Rename and update built-in *groups* Get-LocalGroup | ForEach-Object { if ($entry = $sidMap_Groups[$_.SID.Value]) { # !! See below for why Set-LocalGroup is *not* an option. net localgroup $_.Name /comment:$($entry.Description) $_ | Rename-LocalGroup -NewName $entry.Name } } # Rename and update built-in *users* Get-LocalUser | ForEach-Object { if ($entry = $sidMap_Users[($_.SID.Value -split '-')[-1]]) { # !! See below for why Set-LocalUser is *not* an option. net user $_.Name /comment:$($entry.Description) $_ | Rename-LocalUser -NewName $entry.Name } } 注:

令人费解的是,

Set-LocalUser

$sidMap_Groups = [ordered] @{} Get-LocalGroup | Where-Object { # Infer whether an account is built-in from the number of SID components. ($_.SID.Value -split '-').Count -eq 5 } | ForEach-Object { $sidMap_Groups[$_.SID.Value] = [ordered] @{ Name = $_.Name; Description = $_.Description } } $sidMap_Users = [ordered] @{} Get-LocalUser | Where-Object { # Infer whether an account is built-in from the last SID component. [int] ($_.SID.Value -split '-')[-1] -lt 1000 } | ForEach-Object { $sidMap_Users[($_.SID.Value -split '-')[-1]] = [ordered] @{ Name = $_.Name; Description = $_.Description } }

    

© www.soinside.com 2019 - 2024. All rights reserved.