This method lists the replications that meet a filter criteria.
Syntax
ReplicationServer.EnumReplications(Project, State, Iterator)
Parameters
Project
The name of the project to filter. If Empty (""), filter all projects.
State
The state of the replications that are listed.
Name | Value | Description |
REPL_STATE_EMPTY | 0 | Return all replications. |
REPL_STATE_STARTING | 1 | Return only starting replications. |
REPL_STATE_RUNNING | 2 | Return only running replications. |
REPL_STATE_COMPLETE | 3 | Return only completed replications. |
REPL_STATE_ABORTED | 4 | Return only aborted replications. |
REPL_STATE_CANCELED | 5 | Return only canceled replications. |
REPL_STATE_RECEIVING | 6 | Return only receiving replications. |
REPL_STATE_PENDING | 7 | Return only pending replications. |
Iterator
Used by the service to enumerate the list of replications. This value should be initialized to zero, and should not be modified.
Example
The following example displays the names of all replications that are pending.
Option Explicit
On Error Resume Next
const CRS_ERROR_NO_MORE_ITEMS = 0&80003B17
const REPL_STATE_PENDING = 7
dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")
dim Iterator
Iterator = 0
dim ReplError
Wscript.Echo "The following replications are pending:"
do while True
'Clear any error text
Err.Clear
Set ReplInst = ReplServer.EnumReplications( "", REPL_STATE_PENDING, Iterator )
if IsEmpty(ReplInst) then exit do
ReplError = Err.Number
if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do
Wscript.Echo Replication.Name
Loop
'Release objects
set ReplInst = Nothing
set ReplServer = Nothing
See Also