everyone组_在非英语(国际)版本的Windows上查找EVERYONE组的名称

everyone组

everyone组

I preach a lot about awareness around issues of Internationalization.  Issues arise when we make assumptions.  For example, if you have code that assumes the security group "Everyone" is called "Everyone" on a non-english Windows box...well, you can guess that "results are not guaranteed."

我讲很多关于国际化问题的认识。 当我们做出假设时会出现问题。 例如,如果您的代码假定在非英语的Windows框上将安全组“每个人”称为“每个人” ...那么,您可以猜测“无法保证结果”。

Typically (in C++/SDK) you don't refer to these groups by name, but rather by SID.  Depending on what you're doing, there's a number of ways to figure these things out.  Perhaps instead of using “Everyone,” use the Everyone SID: (S-1–1–0)

通常(在C ++ / SDK中),您不是通过名称来引用这些组,而是通过SID来引用。 根据您的工作,有很多方法可以解决这些问题。 也许不是使用“每个人” 使用所有人的SID: (S-1 ?? 1 ?? 0)

You may want to call AllocateAndInitializeSid...see Creating Security Descriptor and most importantly the list of Well-Known SIDs.

您可能要调用AllocateAndInitializeSid ...请参阅创建安全描述符,最重要的是,请参阅知名SID列表。

Call AllocateAndInitializeSid to obtain the SID of the Everyone group. In the parameters passed to AllocateAndInitializeSid, the number of subauthorities in the SID is set to 1, and the value of the first subauthority is set to SECURITY_WORLD_RID.

调用AllocateAndInitializeSid以获取Everyone组的SID。 在传递给AllocateAndInitializeSid的参数中,SID中的子权限数设置为1,而第一个子权限值设置为SECURITY_WORLD_RID。

PSID BuildEveryoneSid() {
   SID_IDENTIFIER_AUTHORITY auth = SECURITY_WORLD_SID_AUTHORITY;
   PSID pSID = NULL;
   BOOL fSuccess = AllocateAndInitializeSid(&auth, 1,
      SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSID);
   return(fSuccess ? pSID : NULL);
} //(Call FreeSid() when you’re done…)

PSID BuildEveryoneSid(){ SID_IDENTIFIER_AUTHORITY auth = SECURITY_WORLD_SID_AUTHORITY; PSID pSID = NULL; BOOL fSuccess = AllocateAndInitializeSid(&auth,1, SECURITY_WORLD_RID,0,0,0,0,0,0,0,&pSID); return(fSuccess?pSID:NULL); } //(完成后调用FreeSid()?)

Or, call LookupAccountSID and receive the name as an out parameter.

或者,调用LookupAccountSID并接收名称作为out参数。

Or, use this Russian fellow's old util. http://www.chem.msu.su:8080/~rudnyi/NT/sid.txt (sid2user, user2sid, source code here.) from the command line or script and get output like this: 

或者,使用此俄罗斯同伴的旧工具。 从命令行或脚本http://www.chem.msu.su:8080/~rudnyi/NT/sid.txt(sid2user,user2sid 源代码在此处 )并获得如下输出:

C:\Documents and Settings\SHanselm\Desktop\Utils>user2sid "Everyone"
S-1-1-0
Number of subauthorities is 1
Domain is
Length of SID in memory is 12 bytes
Type of SID is SidTypeWellKnownGroup

C:\ Documents and Settings \ Shanselm \ Desktop \ Utils> user2sid“所有人” S-1-1-0 子机构数是1 域为内存中SID的长度为12个字节SID的类型为SidTypeWellKnownGroup

C:\Documents and Settings\SHanselm\Desktop\Utils>sid2user 1 S-1-1-0
Name is Everyone
Domain is
Type of SID is SidTypeWellKnownGroup

C:\ Documents and Settings \ Shanselm \ Desktop \ Utils> sid2user 1 S-1-1-0 名字叫大家域为SID的类型为SidTypeWellKnownGroup

I'm sure there's a way to do with from both Windows Scripting Host (VBS) and .NET (C#) given a SID, so if you know, let me know.

我确信给定SID的Windows脚本宿主(VBS)和.NET(C#)都有一种处理方法,因此,如果您知道,请告诉我。

翻译自: https://www.hanselman.com/blog/finding-out-the-name-of-the-everyone-group-on-a-nonenglish-international-version-of-windows

everyone组

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值