To enumerate all active firewall and Web sessions, all arrays and all servers in each array must be enumerated.
The following file is available for download from the Microsoft Download Center:
Release Date: Oct-23-2002
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
The Enumsessions.exe (or file.hqx) file contains the following files:
File Name | Size |
---|
EnumSessions.cpp | 2,301 bytes |
EnumSessions.dsp | 4,389 bytes |
EnumSessions.dsw | 547 bytes |
Microsoft Visual Basic code similar to the following code sample can be used. For simplicity, the following code uses first server of the first array. You must add Mffpccom.dll in the project references:
Dim objFPC As FPCLib.FPC
Dim server As FPCServer
Dim session As FPCWebSession
Dim firewallsessions As FPCFirewallSessions
Dim firewallsession As FPCFirewallSession
Dim websessions As FPCWebSessions
Dim objFPCArray As FPCArray
Dim szMessage As String
szMessage = "Active sessions:" & vbCrLf
Set objFPC = CreateObject("FPC.Root")
Set objFPCArray = objFPC.Arrays(1)
Set server = objFPCArray.Servers(1)
Set websessions = server.websessions
Set firewallsessions = server.firewallsessions
For Each session In websessions
szMessage = szMessage & session.UserName _
& vbCrLf
Next
For Each firewallsession In firewallsessions
szMessage = szMessage & firewallsession.UserName _
& vbCrLf
Next
If (websessions.Count > 0) _
Or (firewallsessions.Count > 0) Then
MsgBox szMessage
Else
MsgBox "No active sessions"
End If