This method lists the Content Deployment servers.
Syntax
ReplicationServer.EnumServers(Iterator, ServerType)
Parameters
Iterator
Used by the service to enumerate the list of parameters. This value should be initialized to zero, and should not be modified.
ServerType
The type of server listed. The types are:
Server Type | Value | Description |
STAGER | 1 | A staging server. |
ENDPOINT | 2 | A destination server. |
Remarks
You must have Site Server Publishing administrator privileges on the server to call this method.
Example
The following example displays the names of the Content Deployment staging servers.
Option Explicit
On Error Resume Next
const STAGER = 1
const CRS_ERROR_NO_MORE_ITEMS = 0&80003B17
dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")
dim Iterator
Iterator = 0
dim ReplError
dim Server
Wscript.Echo "The Content Deployment staging servers are:"
do while True
'Clear any error text
Err.Clear
set Server = ReplServer.EnumServers(Iterator, STAGER)
if IsEmpty(ReplServer) then exit do
'Quit if "No more items" error
ReplError = Err.Number
if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do
Wscript.Echo ReplServer.Name
Loop
'Release objects
set Server = Nothing
set ReplServer = Nothing
See Also