This method lists the Content Deployment destination servers.
Syntax
ReplicationServer.EnumServers(Iterator, ServerType)
Parameters
Iterator
Used by the service to enumerate the list of destination servers. This value should be initialized to zero, and should not be modified.
ServerType
This parameter is currently ignored.
Server type | Value | Description |
STAGER | 1 | A staging 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 E_NOERROR = 0
const CRS_ERROR_NO_SERVERS = 0&C0003B37
const CRS_ERROR_NO_MORE_ITEMS = 0&80003B17
dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")
dim Iterator
Iterator = 0
dim Server
Wscript.Echo "The Content Deployment staging servers are:"
do while True
'Clear any error text
Err.Clear
Server = ReplServer.EnumServers(Iterator, STAGER)
Select Case Err.Number
Case CRS_ERROR_NO_SERVERS
Wscript.Echo "No destination servers defined."
Wscript.Quit
Case CRS_ERROR_NO_MORE_ITEMS
Exit Do
Case E_NOERROR
Wscript.Echo Server.Name
Case Else
Wscript.Echo "Error " & Err.Number & " (0x" & Hex(Err.Number) _
& ") received " & Message
Wscript.Echo "With description: " & Err.Description
Wscript.Quit
End Select
Loop
'Release objects
set ReplServer = Nothing
See Also