New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Is there a monitor for open sessions to a server?

Votes:

0

Your Vote:

Up

Down

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 by  p_mandryk_admin (0) 1



5 Replies

Votes:

7

Your Vote:

Up

Down

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 by  Thomas Umbricht (2,820) 2 3



Votes:

0

Your Vote:

Up

Down

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 by  Thomas Umbricht (2,820) 2 3



Votes:

0

Your Vote:

Up

Down

Thanks, Thomas. That worked.

Created on Aug 27, 2015 2:15:21 PM by  p_mandryk_admin (0) 1



Votes:

0

Your Vote:

Up

Down

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

Created on Aug 28, 2015 6:16:08 AM by  Jens Kalski (170) 3 1



Votes:

0

Your Vote:

Up

Down

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

http://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 by  Thomas Umbricht (2,820) 2 3



Please log in or register to enter your reply.


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.