DirectoryServerCollection.Add(DirectoryServer) 方法

定义

将指定 DirectoryServer 对象追加到此集合中。Appends the specified DirectoryServer object to this collection.

public:
 int Add(System::DirectoryServices::ActiveDirectory::DirectoryServer ^ server);
public int Add (System.DirectoryServices.ActiveDirectory.DirectoryServer server);
member this.Add : System.DirectoryServices.ActiveDirectory.DirectoryServer -> int
Public Function Add (server As DirectoryServer) As Integer

参数

server
DirectoryServer

要追加到此集合的 DirectoryServer 对象。The DirectoryServer object to append to this collection.

返回

Int32

追加到此集合的从零开始的 DirectoryServer 对象。The zero-based DirectoryServer object that is appended to this collection.

例外

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

集合中已存在该对象。The object already exists in the collection.

servernullserver is null.

尚未将 DirectoryServer 对象保存到 Active Directory 域服务存储区中。The DirectoryServer object has not yet been saved in the Active Directory Domain Services store.

适用于

另请参阅