Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NT User data
Message
From
07/02/2000 08:50:06
 
 
To
07/02/2000 03:13:15
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00328161
Message ID:
00328203
Views:
22
>I need to create, modify and delete NT Users from VFP.
>
>ANy ideas where to start ?

You can use the ADSI automation objects to do this. If your machines are not running Win2K, you can download the ADSI package from msdn.microsoft.com, and it will install on any Windows platform (after 3.1).

oComputer = GETOBJECT("WinNT://MyMachineName")
lcUserName = "Erik"
lcFullName = "Erik Moore"
lcPassword = "smorgasbord"
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

The ADSI object model for the WinNT provider is documented in MSDN.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform