語言

UserPrincipal.GetAuthorizationGroups 方法

定義

回傳一組包含該使用者所屬所有授權群組的主物件集合。 此函式僅回傳安全群組;發行群組不會被回傳。

public:
 System::DirectoryServices::AccountManagement::PrincipalSearchResult<System::DirectoryServices::AccountManagement::Principal ^> ^ GetAuthorizationGroups();
public System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal> GetAuthorizationGroups();
member this.GetAuthorizationGroups : unit -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.Principal>
Public Function GetAuthorizationGroups () As PrincipalSearchResult(Of Principal)

傳回

一組 Principal 包含使用者所屬群組的物件,若使用者不屬於任何安全群組則為空物件。

例外狀況

嘗試取回授權群組失敗。

此作業系統不支援授權群組的檢索。

備註

此方法會遞迴搜尋所有群組,並回傳使用者所屬群組。 回傳的集合也可能包含系統在授權時會視為成員的額外群組。

此方法回傳的群組可能包含與主體不同的作用域與儲存群組。 例如,若主體為 AD DS 物件,其 DN 為「CN=SpecialGroups,DC=Fabrikam,DC=com」,則回傳的集合可能包含屬於「CN=NormalGroups,DC=Fabrikam,DC=com」的群組。

適用於