Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get LDAP attributes used for users
Message
De
22/06/2004 04:39:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00915644
Message ID:
00915938
Vues:
11
>>I'm actually asking for more OTOH. The problem is this :
>>I need a series of fields to be mapped to those from LDAP. Since there is no enforcement within LDAP and ADSI an admin say could use the Company attribute for storing SSNs and PostalAddress to store the user's workstation #. Think my app has a table for user info with fields fieldA and fieldB. I want to ask them which LDAP attribute would map to fieldA and B. Here easiest solution is to give them a textbox to fill :) I was trying to find a if I could instead provide a dropdown.
>>Schema and Configuration is what I'm after I think but not sure yet :)
>>Cetin
>
>
>Cetin, maybe I misunderstood your problem, but anyways I will try to give my solution to what I understood is the problem :) (sorry if I am in the wrong channel)
>
>The idea is using the LDAP WMI provider to find all users, then add all properties to a cursor that has the name of the property as a key and a second field that serves as a counter of how many times this property was set (not null), so at the end when the program finishes (it is not too fast, it took about 1 minute to run in our network with 300+ users) we know which properties were never used (count will be zero)
>
>
>
>loLDAP			= Getobject('Winmgmts://./root/directory/ldap')
>loUsers			= loLDAP.ExecQuery('Select * from ds_user')
>
>create cursor PropCount (Property C(50), UseCount I)
>index on Property tag Property
>
>for each loUser in loUsers
>	wait window loUser.ds_name nowait
>	for each loProperty in loUser.Properties_
>		if not Indexseek(loProperty.Name, .t., 'PropCount', 'Property')
>			insert into PropCount (Property) values (loProperty.Name)
>		endif
>		if not Isnull(loProperty.Value)
>			replace UseCount with UseCount + 1 in PropCount
>		endif
>	endfor
>endfor
>wait clear
>
>
>(notice that the LDAP WMI provider adds the "ds_" prefix to the LDAP properties)
>(where it says Data Session, it should only say d s (a d and a s with no space) but UT changes it)
>HTH

Hugo,
Thanks for replying. I was trying to find a way w/o checking each user (propertylist as ADSI tools present - probably they use a preset list).
Unfortunately WMI syntax for LDAP is new to me, I can't even try this one.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform