Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need NT Administration Examples
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00561854
Message ID:
00561895
Views:
23
This message has been marked as the solution to the initial question of the thread.
>I need to be able to create a VFP exe that runs on an NT server. The exe will run every so often to check for a text file that contains user data. The exe will then parse the text file for adding that new user to the NT and putting that user into defined groups on the NT. What I need is some examples of VFP code that will allow me to add a user to the NT (ensuring the process is run under admin) and also to add that user to defined groups. Any help would be appreciated.

You can do this with the help of ADSI. The examples below should give you a start:
*-- Adds a user
oDomain = GetObject("WinNT://myServer")
oUser = oDomain.Create("user", "Crescencio")
oUser.SetInfo
oUser.SetPassword("mypassword")
oUser.SetInfo
*-- Adds the user to the group
oGroup = oDomain.GetObject("Group", "Power Users")
oGroup.Add("WinNT://myServer/Crescencio")
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform