Domain.CreateTrustRelationship(Domain, TrustDirection) 方法
定义
使用指定的域创建信任关系的双方。Creates both sides of a trust relationship with the specified domain.
public:
void CreateTrustRelationship(System::DirectoryServices::ActiveDirectory::Domain ^ targetDomain, System::DirectoryServices::ActiveDirectory::TrustDirection direction);
public void CreateTrustRelationship (System.DirectoryServices.ActiveDirectory.Domain targetDomain, System.DirectoryServices.ActiveDirectory.TrustDirection direction);
member this.CreateTrustRelationship : System.DirectoryServices.ActiveDirectory.Domain * System.DirectoryServices.ActiveDirectory.TrustDirection -> unit
Public Sub CreateTrustRelationship (targetDomain As Domain, direction As TrustDirection)
参数
- targetDomain
- Domain
表示正在用于创建信任的域的 Domain对象。A Domain object that represents the domain that the trust is being created with.
- direction
- TrustDirection
确定相对于此域的信任方向的 TrustDirection 成员之一。One of the TrustDirection members that determines the direction of the trust, relative to this domain.
例外
信任关系已存在。The trust relationship already exists.
调用基础目录服务导致错误。A call to the underlying directory service resulted in an error.
目标服务器忙或不可用。The target server is either busy or unavailable.
targetDomain 为 null。targetDomain is null.
direction 不是有效的 TrustDirection 值。direction is not a valid TrustDirection value.
已释放此对象。The object has been disposed.
指定的帐户没有权限执行此操作。The specified account does not have permission to perform this operation.
注解
此方法使用单个方法调用创建信任关系的双方。This method creates both sides of a trust relationship with a single method call. Domain.CreateLocalSideOfTrustRelationship方法用于仅创建信任的一方。The Domain.CreateLocalSideOfTrustRelationship method is used to create only one side of a trust.