Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
List Of Win 2000 Users
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00569636
Message ID:
00569741
Vues:
39
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform