What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Is there a monitor for open sessions to a server?

Votes:

0

I'm looking for a way to monitor the count of users attached to a session on a file server. I am trying to get an accurate count of how many concurrent users we have so that I can use these numbers for a VDI proposal and its licensing counts.

I don't want to buy 500 licenses when I only ever have 150 users logged in on a heavy day.

Thanks,

Phil Mandryk

powershell vbscript wmi

Created on Aug 26, 2015 7:18:02 PM



5 Replies

Votes:

7

Hi p_mandryk_admin

Hmm. How about a vbs/wsh script which counts all the sessions on the server? like (getusers.vbs):

Set objConnection = GetObject("WinNT://fileserver01/LanmanServer")
Set colSessions = objConnection.Sessions

dim users 
users = 0

For Each objSession in colSessions
users = users + 1
Next

wscript.echo users

Please check the manual how to get the returnwert with VBS scripts in the PRTG Manual. I never used it before, but it's possible.

Created on Aug 27, 2015 1:05:54 PM



Votes:

0

Ha.. I was curious. Just use

Set objConnection = GetObject("WinNT://fs01/LanmanServer")
Set colSessions = objConnection.Sessions

dim users 
users = 0

For Each objSession in colSessions
users = users + 1
Next

Wscript.Echo users&":Ok" 

Dont forget to change the Servers name in "winNT: fs01...

cheers Thomas

Created on Aug 27, 2015 1:17:19 PM



Votes:

0

Thanks, Thomas. That worked.

Created on Aug 27, 2015 2:15:21 PM



Votes:

0

Hi, pay attention that every user can have multiple sessions to a server.

Created on Aug 28, 2015 6:16:08 AM



Votes:

0

yes you are right, but maybe this helps as well:

https://kb.paessler.com/en/topic/57613-can-you-monitor-server-share-sessions-with-prtg

Or you add Wscript.Echo "User: " & objSession.User in the FOR NEXT Loop, and save the output to a file. -> use Excel for stats.

or simply

*batch* net sess > %time%sessions.txt *batch*

This file can be imported into excel (delimiter tab and space), then manually sort and count. Please be aware, depending on the system language, you have to parse the %time% first, because return has specialcharaters, which cannot be used as filename.

regards Thomas

Created on Aug 28, 2015 11:57:40 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.