Hi All,
Where in the repository SQL database can I see/view the active Laserfiche sessions as shown in the activity node>sessions in the LF admin console?
Cheers!
Chris Douglas
Hi All,
Where in the repository SQL database can I see/view the active Laserfiche sessions as shown in the activity node>sessions in the LF admin console?
Cheers!
Chris Douglas
I'm sure there's an exception, but for the most part everything you can see in admin console or the web client management interface is retrieved via the SDK. You can use `Repository.EnumSessions` to get the session list.
I don't believe that active sessions are represented in the database, they exist in-memory on the Laserfiche server. You can use the SDK to get a listing like the one you see in the admin console.
Thanks Brian, do you have an example or can you point me in the right direction of where in the SDK this is possible as it was my understanding this wasn't possible in the SDK? Cheers!
I'm sure there's an exception, but for the most part everything you can see in admin console or the web client management interface is retrieved via the SDK. You can use `Repository.EnumSessions` to get the session list.
I've attached a PowerShell script I wrote a while back that enumerates sessions for a repository.
Note that it won't run as-is on a Laserfiche 11 system because it tries to load the Laserfiche.RepositoryAccess (RA) library from the machine's GAC (where it was in LF 10). You have to load RA by file path and ensure its various dependent libraries (I think around three) are in the same directory. Alternatively, you can install the Laserfiche SDK 10.4 Runtime, which will install the necessary libraries in the GAC.
Usage is like:
.\ListRepositorySessions.ps1 -serverName 'ecm' -repoName 'LaserRepository' -usernameFilter 'domain\username'
I found a separate PowerShell script snippet (below) that uses Laserfiche.RepositoryAccess.Admin.ServerManagement to enumerate all server sessions. The script it's in is clearly a work-in-progress from some years ago, so I can't guarantee it works. Best to take as pseudocode.
# Set port for connecting to LFS $lfsPort = 80 if ($useTLS) { $lfsPort = 443 } $server = New-Object -TypeName Laserfiche.RepositoryAccess.Server($serverName, $lfsPort, $useTLS) #$serverMgmt = New-Object -TypeName Laserfiche.RepositoryAccess.Admin.ServerManagement($server) $sessions = $server.EnumSessions() $totalConnections = 0; foreach ($sessionInfo in $sessions) { $repoName = $sessionInfo.RepositoryName $appName = $sessionInfo.ApplicationName $userName = $sessionInfo.UserName $clientName = $sessionInfo.ClientHostName Write-Host $userName }