Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List Of Win 2000 Users
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00569636
Message ID:
00569741
Views:
37
>Any know how I can obtain a list of users on a Win 2000 system? I want
>to populate a combo.
>
>Thanks

In the Init of the Combo, you can have code to query a group you set up with all your users:
local logroup, louser, lxx
logroup = getobject('WinNT://MyDomain/MyMachine/MyGroup,group')
lxx = 1
for each louser in logroup.Members
	THIS.AddListItem(louser.Name, lxx)
	lxx = lxx + 1
endfor
THIS.ListIndex = 1
return .T.
If you don't have a group you can use the computer itself and check the Class property of the object in the FOR...ENDFOR loop:
local logroup, louser, lxx
logroup = getobject('WinNT://MyDomain/MyMachine,computer')
lxx = 1
for each louser in logroup
	if upper(louser.Class) = "USER" then
		THIS.AddListItem(louser.Name, lxx)
		lxx = lxx + 1
	endif
endfor
THIS.ListIndex = 1
return .T.
It will take longer because you will be cycling through services, users and groups.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform