I'm trying to find the User name of someone that has a file opened on the network drive programatically, I've been able to fetch their Computer name, but not their user name. If I have the username I can fetch their full name from
I don't have access to query the WMI services on another machine, How would I achieve getting their USER NAME if I know a user's Machine Name?
This code won't work.. since I dont' have the permissions...
Any help is beneficial.
Randall Vollen
Merrill Lynch
Code:
Private Declare Function apiNetUserGetInfo _
Lib "netapi32.dll" Alias "NetUserGetInfo" _
(servername As Any, _
username As Any, _
ByVal Level As Long, _
bufptr As Long) As Long
I don't have access to query the WMI services on another machine, How would I achieve getting their USER NAME if I know a user's Machine Name?
This code won't work.. since I dont' have the permissions...
Code:
Dim strComputer As String
Dim objWMIService As Object
Dim colcomputer As Object
Dim objcomputer As Object
'WXP8NW2T81
strComputer = "WXP8NW2T81"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colcomputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objcomputer In colcomputer
'out put...
Next
Any help is beneficial.
Randall Vollen
Merrill Lynch