C# Code:

CReplicationServer cssSvr = new CReplicationServerClass();
cssSvr.Initialize(Environment.MachineName);

CReplicationProject csPrj = (CReplicationProject)cssSvr.OpenProject("Test", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);


object dummy = new object();
dummy = 0;

while ((int)dummy != -1)
{
  object dummy2 = new object();
  dummy2=0;

  string endpoint = (string)csPrj.EnumDestination(ref dummy);
  Console.WriteLine(endpoint);
}

VBScript Code:

Option Explicit
On Error Resume Next

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

dim Project
dim Iterator
dim ReplProject
dim endpoint
dim ReplError

Iterator = 0

'Clear any error text
Err.Clear

'Get the project
set ReplProject = ReplServer.OpenProject("Test", 2)

do while true
  'Clear any error text
  Err.Clear

  if(Iterator <>-1) then
    endpoint = ReplProject.EnumDestination(Iterator)
    'Display error message and
    'Quit if empty object returned (no more instances)
    if IsEmpty(endpoint) then
      Wscript.Echo "Empty project object returned."
      exit do
    end if

    ReplError = Err.Number

    if Err.Number <> 0 then
      'Display error message and quit
      Wscript.Echo "Error Description: " & Err.Description & "Error Number: " & Err.Number
      exit do
    end if

    Wscript.Echo "Destination Name: " & endpoint
  end if
Loop