Forest.GetForest(DirectoryContext) 方法

定义

获取指定上下文的 Forest 对象。Gets a Forest object for the specified context.

public:
 static System::DirectoryServices::ActiveDirectory::Forest ^ GetForest(System::DirectoryServices::ActiveDirectory::DirectoryContext ^ context);
public static System.DirectoryServices.ActiveDirectory.Forest GetForest (System.DirectoryServices.ActiveDirectory.DirectoryContext context);
static member GetForest : System.DirectoryServices.ActiveDirectory.DirectoryContext -> System.DirectoryServices.ActiveDirectory.Forest
Public Shared Function GetForest (context As DirectoryContext) As Forest

参数

context
DirectoryContext

一个 DirectoryContext 对象,它包含用于检索对象的目标和凭据。A DirectoryContext object that contains the target and credentials to use to retrieve the object.

返回

Forest

Forest 对象,它表示通过此方法检索到的林。A Forest object that represents the forest that was retrieved by this method.

例外

无法与 context 中指定的目标建立连接。A connection to the target that is specified in context could not be made.

调用基础目录服务导致错误。A call to the underlying directory service resulted in an error.

context 无效。context is not valid.

contextnullcontext is null.

适用于

另请参阅