Previous in Contents Next in Contents

EnumEventSinks Method

This method lists all event sinks.

Syntax

ReplicationServer.EnumEventSinks(Iterator)

Parameters

Iterator

Used by the service to enumerate the list of event sinks. This value should be initialized to zero, and should not be modified.

Remarks

The following event sink ProgIDs are defined:

CRSSink.CRSDBSink

The local database event sink, such as CRSLocalEvents.

CRSSink.CRSSink

The forwarding (to another Content Deployment site server) event sink.

CRSSink.CRSMailSink

The mail event sink. This event sink is also identified by its Name property, Mail.

CRSSink.CRSNTSink

The Microsoft® Windows NT® event sink. This event sink is also identified by its Name property, NT.

Example

The following example displays the names of all event sinks.

Option Explicit 
On Error Resume Next 

const E_NOERROR                = 0
const CRS_ERROR_NO_EVENT_SINKS = 0&C0003B29
const CRS_ERROR_NO_MORE_ITEMS  = 0&80003B17

dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")

dim Iterator
Iterator = 0
dim ReplError
dim EvSink
Wscript.Echo "The server has the following event sinks"

do
  'Clear any error text
  Err.Clear

  set ReplSink = ReplServer.EnumEventSinks(Iterator)

  Select Case Err.Number

    Case CRS_ERROR_NO_EVENT_SINKS
      Wscript.Echo "No event sinks defined."
      Wscript.Quit

    Case CRS_ERROR_NO_MORE_ITEMS
      Exit Do

    Case E_NOERROR
      Wscript.Echo ReplSink.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 ReplSink   = Nothing
set ReplServer = Nothing

See Also

AddEventSink, DeleteEventSink, ReplicationEventSinkConfig


© 1997-2000 Microsoft Corporation. All rights reserved.