Principal.GetGroups 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一組群組物件,指定當前主體所屬群組。
多載
| 名稱 | Description |
|---|---|
| GetGroups() |
回傳一組群組物件,指定當前主體所屬群組。 |
| GetGroups(PrincipalContext) |
回傳一組主體成員且存在於指定上下文參數所提供的儲存中的群組物件集合。 |
備註
此超載方法僅回傳主體直接成員的群組;不進行遞迴搜尋。 遞迴搜尋結果可用於使用者主物件。 如需詳細資訊,請參閱 GetAuthorizationGroups 方法。
若主要儲存為 AD DS,群組清單包含使用者的主要群組,該群組由 AD DS 物件中的主要群組 ID 屬性識別。
GetGroups()
- 來源:
- Principal.cs
- 來源:
- Principal.cs
- 來源:
- Principal.cs
- 來源:
- Principal.cs
回傳一組群組物件,指定當前主體所屬群組。
public:
System::DirectoryServices::AccountManagement::PrincipalSearchResult<System::DirectoryServices::AccountManagement::Principal ^> ^ GetGroups();
public System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal> GetGroups();
[System.Security.SecurityCritical]
public System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal> GetGroups();
member this.GetGroups : unit -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal>
[<System.Security.SecurityCritical>]
member this.GetGroups : unit -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal>
Public Function GetGroups () As PrincipalSearchResult(Of Principal)
傳回
一組 GroupPrincipal 物件,指定當前主體所屬的群組。
- 屬性
備註
此方法僅回傳主體直接屬於的群;不進行遞迴搜尋。 遞迴搜尋結果可用於使用者主物件。 如需詳細資訊,請參閱 GetAuthorizationGroups 方法。
此方法回傳的群組可能包含與主體不同的作用域與儲存群組。 例如,若主體為 AD DS 物件,其 DN 為「CN=SpecialGroups,DC=Fabrikam,DC=com」,則回傳的集合可能包含屬於「CN=NormalGroups,DC=Fabrikam,DC=com」的群組。
若目前主體是 AD DS 主體,回傳的群組會包含主體的主要群組,這可由 AD DS 物件上的「primaryGroupId」屬性標示。
另請參閱
適用於
GetGroups(PrincipalContext)
- 來源:
- Principal.cs
- 來源:
- Principal.cs
- 來源:
- Principal.cs
- 來源:
- Principal.cs
回傳一組主體成員且存在於指定上下文參數所提供的儲存中的群組物件集合。
public:
System::DirectoryServices::AccountManagement::PrincipalSearchResult<System::DirectoryServices::AccountManagement::Principal ^> ^ GetGroups(System::DirectoryServices::AccountManagement::PrincipalContext ^ contextToQuery);
public System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal> GetGroups(System.DirectoryServices.AccountManagement.PrincipalContext contextToQuery);
[System.Security.SecurityCritical]
public System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal> GetGroups(System.DirectoryServices.AccountManagement.PrincipalContext contextToQuery);
member this.GetGroups : System.DirectoryServices.AccountManagement.PrincipalContext -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal>
[<System.Security.SecurityCritical>]
member this.GetGroups : System.DirectoryServices.AccountManagement.PrincipalContext -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal>
Public Function GetGroups (contextToQuery As PrincipalContext) As PrincipalSearchResult(Of Principal)
參數
傳回
一組 GroupPrincipal 物件,指定當前主體所屬的群組。
- 屬性
備註
此方法僅回傳主體直接屬於的群;不進行遞迴搜尋。 遞迴搜尋結果可用於使用者主物件。 如需詳細資訊,請參閱 GetAuthorizationGroups 方法。
此方法回傳的群組可能包含與主體不同的作用域與儲存群組。 例如,若主體為 AD DS 物件,其 DN 為「CN=SpecialGroups,DC=Fabrikam,DC=com」,則回傳的集合可能包含屬於「CN=NormalGroups,DC=Fabrikam,DC=com」的群組。
若目前主體是 AD DS 主體,回傳的群組會包含主體的主要群組,並依照 AD DS 物件上的主要群組 ID 屬性所示。