Discussion on:
Shared Session data with VB6 + WMI?

2
Comments

Join the conversation!

Follow via:
RSS
Email Alert
Just In
tcolgrove@... 6th Jul 2004
Win32_ServerConnection will show you that information. It's properties include .ComputerName, .ShareName, .UserName

'--------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSessions = objWMIService.InstancesOf("Win32_ServerConnection")
For Each Connection In colSessions
'Put your code here
Next

Tags: programming

I'm using VB 6 on Windows XP Pro -
I need to know how to grab the "Shared Folders Sessions" collection. (This can be viewed on XP by right clicking my computer, click manage, then shared folders, sessions)

I've been told I can use WMI in VB6 to do this, but I don't know where to find the code....please provide code to grab this collection info. I need VB to do it, not a VBS script file.

Thanks!!!
0 Votes
+ -
tcolgrove@... 6th Jul 2004
Win32_ServerConnection will show you that information. It's properties include .ComputerName, .ShareName, .UserName

'--------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSessions = objWMIService.InstancesOf("Win32_ServerConnection")
For Each Connection In colSessions
'Put your code here
Next
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.