DirectoryEntry イベント
DirectoryEntry クラス
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
解説
オブジェクトのバインド、または属性の読み取りおよび更新を行うには、このクラスを使用します。ヘルパー クラスと共に、DirectoryEntry は、有効期間管理およびナビゲーション メソッドのサポートを提供します。これらには、子ノードの作成、削除、名前の変更、移動、および子の列挙が含まれます。ノードを変更したら、その変更をコミットして、ツリーに保存する必要があります。詳細については、CommitChanges プロパティのトピックを参照してください。
DirectoryEntry を使用すると、スキーマ エントリから、通常のエントリと、すべてではありませんが一部の情報にアクセスできます。
Active Directory 階層は、最大数千のノードを格納します。各ノードは、ネットワーク プリンタまたはドメイン内のユーザーなどのオブジェクトを表します。企業のネットワークは、新しい従業員が採用されるたびに頻繁に変更され、ネットワーク プリンタやコンピュータなどのオブジェクトが追加されます。ADSI (Active Directory Service Interfaces) 技術を使用すると、プログラムによって、これらのオブジェクトをディレクトリ ツリーに追加できます。
階層内にディレクトリ エントリを作成するには、Children プロパティを使用します。Children プロパティは、Add メソッドを提供するコレクションです。これを使用して、現在バインドされている親ノードの直下のコレクションにノードを追加します。コレクションにノードを追加するときに、新しいノードの名前と、そのノードに関連付けるスキーマ テンプレートの名前を指定する必要があります。たとえば、"Computer" という名前のスキーマを使用して、階層に新しいコンピュータを追加できます。
このクラスには、ネットワーク トラフィックを最適化するために役立つ属性キャッシュもあります。属性キャッシュを使用するには、UsePropertyCache プロパティのトピックを参照してください。
DirectoryEntry コンポーネントに関連付けられるクラスは、任意の Active Directory サービス プロバイダで使用できます。現在のプロバイダには、IIS (Internet Information Services)、LDAP (Lightweight Directory Access Protocol)、NDS (Novell NetWare Directory Service)、WinNT などがあります。
メモ |
---|
このクラスを使用するには、Active Directory の一般的な知識が必要です。詳細については、System.DirectoryServices 名前空間の概要のトピックを参照してください。 |
- DirectoryServicesPermission LinkDemand
System.MarshalByRefObject
System.ComponentModel.Component
System.DirectoryServices.DirectoryEntry
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DirectoryEntry コンストラクタ ()
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
.NET Framework のセキュリティ
- DirectoryServicesPermission Demand
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DirectoryEntry コンストラクタ (String)
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
使用例
DirectoryEntry オブジェクトを指定したパスのディレクトリ エントリにバインドし、そのノードの Children プロパティで指定される各子エントリの Path プロパティを出力するコード例を次に示します。
Public Class PrintChildren 'Entry point which delegates to C-style main Private Function. Public Overloads Shared Sub Main() Main(System.Environment.GetCommandLineArgs()) End Sub Overloads Public Shared Sub Main(args() As String) Dim objDE As DirectoryEntry Dim strPath As String = "LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com" If args.Length > 0 Then strPath = args(1) End If ' Create a new DirectoryEntry with the given path. objDE = New DirectoryEntry(strPath) Dim objChildDE As DirectoryEntry For Each objChildDE In objDE.Children Console.WriteLine(objChildDE.Path) Next objChildDE End Sub 'Main End Class 'PrintChildren
public class PrintChildren{ public static void Main(String[] args) { DirectoryEntry objDE; String strPath="LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com"; if(args.Length>0)strPath=args[1]; // Create a new DirectoryEntry with the given path. objDE=new DirectoryEntry(strPath); foreach(DirectoryEntry objChildDE in objDE.Children) Console.WriteLine(objChildDE.Path); } }
int main() { String^ args[] = Environment::GetCommandLineArgs(); DirectoryEntry^ objDE; String^ strPath = "LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com"; if(args->Length>1) { strPath=args[1]; } // Create a new DirectoryEntry with the given path. objDE = gcnew DirectoryEntry(strPath); System::Collections::IEnumerator^ enum0 = objDE->Children->GetEnumerator(); while (enum0->MoveNext()) { DirectoryEntry^ objChildDE = safe_cast<DirectoryEntry^>(enum0->Current); Console::WriteLine(objChildDE->Path); } }
- DirectoryServicesPermission Demand
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DirectoryEntry コンストラクタ (String, String, String)
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
Dim path As String Dim username As String Dim password As String Dim instance As New DirectoryEntry(path, username, password)
- DirectoryServicesPermission Demand
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DirectoryEntry コンストラクタ
オーバーロードの一覧
名前 | 説明 |
---|---|
DirectoryEntry () | DirectoryEntry クラスの新しいインスタンスを初期化します。 |
DirectoryEntry (Object) | 指定したネイティブ Active Directory オブジェクトにバインドする DirectoryEntry クラスの新しいインスタンスを初期化します。 |
DirectoryEntry (String) | 指定したパスにある Active Directory のノードにバインドする DirectoryEntry クラスの新しいインスタンスを初期化します。 |
DirectoryEntry (String, String, String) | DirectoryEntry クラスの新しいインスタンスを初期化します。 |
DirectoryEntry (String, String, String, AuthenticationTypes) | DirectoryEntry クラスの新しいインスタンスを初期化します。 |
DirectoryEntry コンストラクタ (String, String, String, AuthenticationTypes)
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
Public Sub New ( _ path As String, _ username As String, _ password As String, _ authenticationType As AuthenticationTypes _ )
Dim path As String Dim username As String Dim password As String Dim authenticationType As AuthenticationTypes Dim instance As New DirectoryEntry(path, username, password, authenticationType)
public DirectoryEntry ( string path, string username, string password, AuthenticationTypes authenticationType )
public: DirectoryEntry ( String^ path, String^ username, String^ password, AuthenticationTypes authenticationType )
public DirectoryEntry ( String path, String username, String password, AuthenticationTypes authenticationType )
public function DirectoryEntry ( path : String, username : String, password : String, authenticationType : AuthenticationTypes )
- DirectoryServicesPermission Demand
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DirectoryEntry コンストラクタ (Object)
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
解説
このコンストラクタを使用すると、プログラムで、ネイティブ API を通じて IAD インターフェイスを実装するネイティブ Active Directory オブジェクトに対して、DirectoryEntry クラスのメソッドとプロパティを使用できます。IAD インターフェイスの詳細については、MSDN ライブラリ (http://msdn.microsoft.com/library) の「IADs」を参照してください。
- DirectoryServicesPermission Demand
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DirectoryEntry プロパティ
パブリック プロパティ
名前 | 説明 | |
---|---|---|
AuthenticationType | 使用する認証の種類を取得または設定します。 | |
Children | Active Directory 階層でこのノードの子エントリを取得します。 | |
Container | Component を格納している IContainer を取得します。 ( Component から継承されます。) | |
Guid | DirectoryEntry の GUID を取得します。 | |
Name | 基になるディレクトリ サービスで命名されているオブジェクトの名前を取得します。 | |
NativeGuid | プロバイダが返す DirectoryEntry の GUID を取得します。 | |
NativeObject | ADSI オブジェクトを取得します。 | |
ObjectSecurity | このエントリのセキュリティ記述子を取得または設定します。 | |
Options | このエントリのプロバイダ固有のオプションを取得します。 | |
Parent | Active Directory 階層でのエントリの親を取得します。 | |
Password | クライアントの認証時に使用するパスワードを設定します。 | |
Path | DirectoryEntry のパスを取得または設定します。 | |
Properties | この DirectoryEntry オブジェクトの Active Directory のプロパティを取得します。 | |
SchemaClassName | この DirectoryEntry オブジェクトのスキーマ クラスの名前を取得します。 | |
SchemaEntry | このエントリのスキーマ オブジェクトを取得します。 | |
Site | Component の ISite を取得または設定します。 ( Component から継承されます。) | |
UsePropertyCache | 操作を行うたびにキャッシュをコミットするかどうかを示す値を取得または設定します。 | |
Username | クライアントの認証時に使用するユーザー名を取得または設定します。 |
名前 | 説明 | |
---|---|---|
CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。 ( Component から継承されます。) | |
DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。 ( Component から継承されます。) | |
Events | Component に結び付けられているイベント ハンドラのリストを取得します。 ( Component から継承されます。) |
DirectoryEntry メソッド
パブリック メソッド
名前 | 説明 | |
---|---|---|
Dispose | オーバーロードされます。 オーバーライドされます。 DirectoryEntry オブジェクトによって使用されているリソースを解放します。 | |
Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 ( Component から継承されます。) | |
GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 ( Component から継承されます。) | |
MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |
DirectoryEntry メンバ
Active Directory 階層のノードまたはオブジェクトをカプセル化する DirectoryEntry クラス。
DirectoryEntry データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック プロパティ
名前 | 説明 | |
---|---|---|
AuthenticationType | 使用する認証の種類を取得または設定します。 | |
Children | Active Directory 階層でこのノードの子エントリを取得します。 | |
Container | Component を格納している IContainer を取得します。(Component から継承されます。) | |
Guid | DirectoryEntry の GUID を取得します。 | |
Name | 基になるディレクトリ サービスで命名されているオブジェクトの名前を取得します。 | |
NativeGuid | プロバイダが返す DirectoryEntry の GUID を取得します。 | |
NativeObject | ADSI オブジェクトを取得します。 | |
ObjectSecurity | このエントリのセキュリティ記述子を取得または設定します。 | |
Options | このエントリのプロバイダ固有のオプションを取得します。 | |
Parent | Active Directory 階層でのエントリの親を取得します。 | |
Password | クライアントの認証時に使用するパスワードを設定します。 | |
Path | DirectoryEntry のパスを取得または設定します。 | |
Properties | この DirectoryEntry オブジェクトの Active Directory のプロパティを取得します。 | |
SchemaClassName | この DirectoryEntry オブジェクトのスキーマ クラスの名前を取得します。 | |
SchemaEntry | このエントリのスキーマ オブジェクトを取得します。 | |
Site | Component の ISite を取得または設定します。(Component から継承されます。) | |
UsePropertyCache | 操作を行うたびにキャッシュをコミットするかどうかを示す値を取得または設定します。 | |
Username | クライアントの認証時に使用するユーザー名を取得または設定します。 |
名前 | 説明 | |
---|---|---|
CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。(Component から継承されます。) | |
DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。(Component から継承されます。) | |
Events | Component に結び付けられているイベント ハンドラのリストを取得します。(Component から継承されます。) |
名前 | 説明 | |
---|---|---|
Dispose | オーバーロードされます。 オーバーライドされます。 DirectoryEntry オブジェクトによって使用されているリソースを解放します。 | |
Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 (Component から継承されます。) | |
GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 (Component から継承されます。) | |
MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |
参照
Weblioに収録されているすべての辞書からDirectoryEntryを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からDirectoryEntry を検索
- DirectoryEntryのページへのリンク