Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How reliable/secure are getenv('User') & WScript.Network
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00953302
Message ID:
00954683
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
Rodd, Here you have some code to test (it will require VFP 7+, I think):
try
	loWBEMLocator	= createObject("wbemScripting.SwbemLocator")
	loWMIService	= loWBEMLocator.ConnectServer()
catch
	loWMIService	= null
endtry

if not Isnull(loWMIService)
	loCSs			= loWMIService.ExecQuery('Select * from Win32_LoggedOnUser')
	for each loCS in loCSs
		try
			loUser	= Getobject('Winmgmts:' + Strtran(loCS.Antecedent, '//', '/'))
			? 'Domain     : ', loUser.Domain
			? 'Local?     : ', loUser.LocalAccount
			? 'Name       : ', loUser.Name
		catch
			? 'Error getting the User data'
		endtry
	endfor
endif
I this somewhat answers you question (Although I can not test for sure, I am only logged into my domain), the only problem is getting rid of the System accounts (Like SYSTEM, LOCAL SERVICE, NETWORK SERVICE, etc)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform