Domain.CreateLocalSideOfTrustRelationship(String, TrustDirection, String) 方法
定义
创建与指定域存在信任关系的本地方。Creates the local side of a trust relationship with the specified domain.
public:
void CreateLocalSideOfTrustRelationship(System::String ^ targetDomainName, System::DirectoryServices::ActiveDirectory::TrustDirection direction, System::String ^ trustPassword);
public void CreateLocalSideOfTrustRelationship (string targetDomainName, System.DirectoryServices.ActiveDirectory.TrustDirection direction, string trustPassword);
member this.CreateLocalSideOfTrustRelationship : string * System.DirectoryServices.ActiveDirectory.TrustDirection * string -> unit
Public Sub CreateLocalSideOfTrustRelationship (targetDomainName As String, direction As TrustDirection, trustPassword As String)
参数
- targetDomainName
- String
与其创建信任关系的域的 DNS 名称。The DNS name of the domain that the trust is created with.
- direction
- TrustDirection
确定相对于此域的信任方向的 TrustDirection 成员之一。One of the TrustDirection members that determines the direction of the trust, relative to this domain.
- trustPassword
- String
信任的密码。The password for the trust.
例外
信任关系已存在。The trust relationship already exists.
调用基础目录服务导致错误。A call to the underlying directory service resulted in an error.
目标服务器忙或不可用。The target server is either busy or unavailable.
targetDomainName 或 trustPassword 为空。targetDomainName or trustPassword is empty.
targetDomainName 或 trustPassword 为 null。targetDomainName or trustPassword 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 one side of a trust relationship. 只有在创建信任的双方后,才会建立信任。The trust is not established until both sides of the trust have been created.
trustPassword参数将密码与创建的信任相关联。The trustPassword parameter associates a password with the created trust. 当创建信任的另一方时,将提供相同的密码,然后将两个本地信任相互绑定。When the other side of the trust is created, the same password is provided and the two local trusts are then bound to each other.
若要以编程方式在单个方法调用中创建信任关系的双方,请使用 Domain.CreateTrustRelationship 方法。To programmatically create both sides of a trust relationship in a single method call, use the Domain.CreateTrustRelationship method.