ServiceSessions Method


Get session count of specified server.

long ServiceSessions([in] BSTR Name)

Parameters

Name

Service name, it can be smtpd, pop3d, webmail or rocd.

Return Value

This method returns total count of current active sessions of specified service.

Usage Example

Dim server, user, password, requestAddr
server = "localhost"
user = "system"
password = "mypassword"
requestAddr = "192.168.0.1"

Dim oSvr
Set oSvr = CreateObject("EmailArchitectObjects.ServerRoot")
r = oSvr.Connect( server, user, password, 0, requestAddr )
If r <> 0 Then
  WScript.Echo( "connect server failed!" )
End If

Dim oServices
Set oServices = oSvr.ServiceCollection

Dim arServices
arServices = Array( "smtpd", "pop3d", "webmail", "rocd" )

Dim i, nCount
nCount = UBound(arServices)
For i = LBound(arServices) To nCount
  WScript.Echo( arServices(i) & "has " & _
  oServices.ServiceSessions(arServices(i)) & " active sessions." )
Next

See Also

ServiceStatus
GetConnectionInfo
TerminateConnection

EmailArchitect Email Server SDK Document Index

Copyright © 2006 - 2025 AIFEI & AdminSystem Software Limited. All rights reserved.