【问题标题】:How to determine whether a group is security group?如何判断一个组是否是安全组?
【发布时间】:2010-08-24 08:41:33
【问题描述】:

我需要使用 C# 代码检查按名称给出的组是否是 AD 中的安全组。 我注意到组属性中有一个名为“groupType”的属性,但我不知道该属性的用途。我检查了几个组,发现它的值可以是 null、8 或 -2147483646。是否与安全组类型相关联? 我还发现在组的 distinctName 中,可以有“OU=Security Group”或“OU=Secuity Group with Mail Lists”blabla。是否可以作为确定安全组类型的标准? 提前致谢。

【问题讨论】:

    标签: active-directory directoryservices


    【解决方案1】:

    来自http://adsearch-winzero.blogspot.com/2006/04/object-group-attribute-grouptype.html

    The groupType attribute returns the type of group. However the returned value is in RAW format.
    
    ...
    
    -2147483646 ~ Global Security Group
    -2147483644 ~ Local Security Group
    -2147483643 ~ BuiltIn Group
    -2147483640 ~ Universal Security Group
    
    2 ~ Global Distribution Group
    4 ~ Local Distribution Group
    8 ~ Universal Distribution Group
    

    【讨论】:

      【解决方案2】:

      您可以使用“安全组”作为查询条件。但根据贵公司的设置方式,它并不是那么值得信赖。最好为所有安全组都有一个 OU 条目并直接使用该条目。

      【讨论】:

        【解决方案3】:

        出于对马特的尊重,更好的答案应该来自微软:

        https://msdn.microsoft.com/en-us/library/ms675935(v=vs.85).aspx

        值相同,但仍应来自创建者。 * 安全组是通过将安全组值 -2147483648 与 * 通讯组值相加得出的。

        https://blogs.technet.microsoft.com/heyscriptingguy/2004/12/21/how-can-i-tell-whether-a-group-is-a-security-group-or-a-distribution-group/

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2018-04-15
          • 1970-01-01
          • 2019-02-11
          • 1970-01-01
          • 1970-01-01
          • 2019-09-17
          • 2020-05-16
          相关资源
          最近更新 更多