Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need NT Administration Examples
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00561854
Message ID:
00561895
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform