Principal.GetGroups メソッド

定義

現在のプリンシパルがメンバーであるグループを指定するグループ オブジェクトのコレクションを返します。

オーバーロード

名前 説明
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 メソッドを参照してください。

このメソッドによって返されるグループには、プリンシパルとは異なるスコープとストアのグループが含まれる場合があります。 たとえば、プリンシパルが "CN=SpecialGroups,DC=Fabrikam,DC=com" の DN を持つ AD DS オブジェクトの場合、返されるセットには"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)

パラメーター

contextToQuery
PrincipalContext

クエリを実行するコンテキストを指定する PrincipalContext オブジェクト。

コンテキストが別のドメインにある場合、クエリは、指定されたコンテキスト内のプリンシパル オブジェクトの表現に対して実行されます。

返品

現在のプリンシパルがメンバーであるグループを指定する GroupPrincipal オブジェクトのコレクション。

属性

注釈

このメソッドは、プリンシパルが直接メンバーであるグループのみを返します。再帰検索は実行されません。 再帰的な検索結果は、ユーザー プリンシパル オブジェクトで使用できます。 詳細については、 GetAuthorizationGroups メソッドを参照してください。

このメソッドによって返されるグループには、プリンシパルとは異なるスコープとストアのグループが含まれる場合があります。 たとえば、プリンシパルが "CN=SpecialGroups,DC=Fabrikam,DC=com" の DN を持つ AD DS オブジェクトの場合、返されるセットには"CN=NormalGroups,DC=Fabrikam,DC=com" に属するグループを含めることができます。

現在のプリンシパルが AD DS プリンシパルの場合、返されるグループには、AD DS オブジェクトのプライマリ グループ ID 属性で示されるプリンシパルプライマリ グループが含まれます。

こちらもご覧ください

適用対象