Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a requirement to scan 750 (windows 2003) file and print servers for details of the connected sessions. I thought I'd cracked this using the Win32_ServerSession Class until I discovered that a session with an ActiveTime of around 15 hours (from the Win32_ServerSession Class) was showing with a Connected Time of around 62 days in the Computer Management/Shared Folders/Sessions GUI!

I can get from the LogonID of Win32_Session via the Name in Win32_LoggedOnUser and thence to the Win32_ServerSession Class but that's one remote WMI call to get a list of sessions and then two further remote WMI calls per session. That could easily take 15 minutes per server!

So, does anyone know how to get the data shown in the Computer Management/Shared Folders/Sessions GUI programmatically (preferably in VB.Net but C# would do).

Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900