Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating users/passwords on nt for web application
Message
De
28/03/2000 07:25:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00350936
Message ID:
00351308
Vues:
20
Thanks Rick:

I bought your book a month ago but not too much mentioned on ADSI in it. I'm still very new at this web development stuff!

Sheena



>You can use the code below in an ASP page with a few syntax modifications for VBScript. Or you can use the VFP code in a VFP COM object (but that seems silly since it's not really doing anything you can't do directly in the ASP page).
>
>For error handling and checking for existing users you have to use the full ADSI path for the user and see if that returns a valid value.
>
>+++ Rick ---
>
>>Hello:
>>
>>I need to create, modify and delete NT Users from a VFP com. I wanted to build a html form that users can add their own
>>accounts and passwords.
>>
>>I was told I can do the following:
>>
>>1) download the adsi package
>>
>>2) do I put this code in an asp page, or com on the server?
>>
>>
>> oComputer = GETOBJECT("WinNT://MyMachineName")
>> lcUserName = "Sheena"
>> lcFullName = "Sheena Escott"
>> lcPassword = "jiggle"
>> lcDescription = "Programmer Type"
>>
>> oNewUser = oComputer.Create("User",lcUserName)
>> oNewUser.Setinfo() && Adds the account. This line throws the error if the user exists, or if there's any other problem
>> oNewUser.SetPassword(lcPassword)
>> oNewUser.FullName = lcFullName
>> oNewUser.Decription = lcDescription
>> oNewUser.SetInfo() && Finalizes the settings
>>
>>Any input would be appreciated.
>> The ADSI object model for the WinNT provider is documented in MSDN.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform