General discussion

  • Creator
    Topic
  • #2093264

    Add user account to WinNT with a program

    Locked

    by zlatin zlatev ·

    Well,
    Can anybody help me with that problem:
    I want to add with VC,VB or VFP(FoxPro) program a user account to WinNT User Manager.
    Is there a way to do this, i.e. WinAPI functions, Registry hacks, etc.
    Any help – welcome, especially tech-info and program code!
    Regards,
    The BIG RED FOX

All Comments

  • Author
    Replies
    • #3869940

      Add user account to WinNT with a program

      by syscokid ·

      In reply to Add user account to WinNT with a program

      One possibility would be to shell out of the program and run the native NT command “net user”. For example,

      net user / /add /domain

    • #3869341

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      Actually I’m looking for a way to do that with no any use of external apps, even from SDKs, Resource Kits, other tools that are “standard” for the OS, etc.
      (I do not like to use ShellExecute when I can avoid it)

      btw. I’ve seen that in NTFAQ as:”How can I add a user from the command line?”
      http://www.windows2000faq.com/Articles/Index.cfm?ArticleID=15064

    • #3869340

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      Actually I’m looking for a way to do that with no any use of external apps, even from SDKs, Resource Kits, other tools that are “standard” for the OS, etc.
      (I do not like to use ShellExecute when I can avoid it)

      btw. I’ve seen that you’ve offered me, in NTFAQ as:
      “How can I add a user from the command line?”
      http://www.windows2000faq.com/Articles/Index.cfm?ArticleID=15064

    • #3870470

      Add user account to WinNT with a program

      by kent.manley ·

      In reply to Add user account to WinNT with a program

      Gee, why don’t you grab a win32 api manual and a c++ compiler and get to work?

      There are at least three ways I know to do this:
      1) NT Resource kit adduser program
      2) win32 perl with win32 extension
      3) VBScript can access the objects and methods you want.

      What’s your motivation for avoiding the api calls?

      Kent

      • #3866323

        Add user account to WinNT with a program

        by zlatin zlatev ·

        In reply to Add user account to WinNT with a program

        Well, actually I do not have a GOOD WinAPI manual, and am learning WinAPI functions from demos, source codes and tech-infos (mail-lists, discussion boards, etc.)
        I DO NOT want to use PERL, actually I want to do this from a FoxISAPI server so it will be done in Visual FoxPro code.
        Almost the same is with VBScript.
        I can “translate” VB/VC++ code to VFP. I have basic knowledge in VB/VC++, and I haven’t found yet many programs that I do not understand what they do.

    • #3870407

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      I do not avoid api calls. I just do not want to call external EXEs

    • #3868775

      Add user account to WinNT with a program

      by maunteljw ·

      In reply to Add user account to WinNT with a program

      If you look in the NT Resourse Kit, there is a VB Script that can accomplish that. (Useraccount.vbs) I’ve used this before and it did the job.

      • #3866324

        Add user account to WinNT with a program

        by zlatin zlatev ·

        In reply to Add user account to WinNT with a program

        I have checked the VBS that you send to me… Thanks BUT…
        No, this is *not* what I want to do.

        This VBS just *shows* the user accounts from the NT server.
        It uses some CScript classes that I DO NOT know how they work, so I cannot convert thisto a code for *ADDING* User account to the remote NT Server.

    • #3868606

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      Well I’m going to check the NT Resource kit.

    • #3866321

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      Actually I’ve found a VB code that may be what I need…

      See the following topic:

      “visual basic, vb, vbscript,
      Create-Destroy User on Domain (Administrating NT)”

      at :

      http://www.planet-source-code.com/xq/ASP/txtCodeId.532/lngWId.1/qx/vb/scripts/ShowCode.htm

      The question is still open…
      If someone knows a ‘better’ way to do this…
      and wants to share it with me –
      he/she is welcome 🙂

      Regards,
      The BIG RED FOX

    • #3867701

      Add user account to WinNT with a program

      by kent.manley ·

      In reply to Add user account to WinNT with a program

      The entire Win32 API is posted on http://msdn.microsoft.com.

      You have to drill down a bit to get to it – look in the SDKs topics – but it’s there, really!

      Also, there are a couple of EXCELLENT Win32 API References out there:

      And I believe that New Riders has just published one that looks very thorough, although I haven’t had a chance to read it.

      Good luck,

      Kent

    • #3761839

      Add user account to WinNT with a program

      by remeltdb ·

      In reply to Add user account to WinNT with a program

      The NT40 Resource Kit includes a utility called ADDUSER.EXE that I have used in the past with very good results. We were migrating from Netware to NT and did not want to use the Netware Migration Tool so I used ADDUSER.EXE to create users groups etc.

      All the user names, group names etc. are stored in a separate comma-delimited file.

      Regards,
      Dave

    • #3871775

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      Well, I know that this is ANOTHER question, but I have problems with creating the USER_INFO structure (as described in Visual Studio’s MSDN Library) under Visual FoxPro. VFP does NOT support pointers and user defined types, so I have to trick it with Strings and WinApi functions, but maybe I’m doing something wrong, because NetAddUser does not create the user account and returns status code 53 (???) or if I call it twice it returns (on the second call) status code 124 (user already exists), butI actually do not see any new user added in user manager.
      Can anybody help me with this stuff?
      (I will send him/her the VFP code that I’m trying to use).

    • #3878136

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      Tech points update…

      *NOTE*
      1. I have Visual Studio MSDN Library and have read it.
      2. I have checked also the Online MSDN library.
      3. I have the entire MS Visual Studio 6.0
      (VC, VB, VFP, VID, the API Viewer that is shiped with VB, the MSDN library)
      4. ***** I DO NOT Want to USE external EXEcutables

      5. I know that the NetUser WinApi and the ADSI can work for me.

      6. I am looking for easy way to do this from Microsoft VISUAL FOXPRO

      7. I am working over that problem, so it is possible to find out the answer *without* your help

      Regards,
      Zlatin Zlatev

    • #3842817

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      I have found a solution for the problem with odd status codes.
      In fact I was trying to use an ASCII version of the
      lstrcpy
      function for “creating” pointers and that was the reason for the malfunction of the NetUserAdd
      WinApi function…

      Because I think that I can do this myself,
      I’m going to close that question soon.

      However, yet there are a lot of problems to do with – one is with the users SIDs and adding the users to Localgroups.

      Best wishes,
      Zlatin Zlatev,
      Software Engineer and Programmer Mentor
      JEI-Bulgaria

    • #3724624

      Add user account to WinNT with a program

      by jereg ·

      In reply to Add user account to WinNT with a program

      Please close the question.

    • #3561715

      Add user account to WinNT with a program

      by maxwell edison ·

      In reply to Add user account to WinNT with a program

      Greetings,

      These sites have articles that should help you in that regard.

      (REMOVE SPACES if they snuck into the pasted URLs)

      http://msevents.microsoft.com/events/USA/ENU/detail/ED103389632.htm

      http://msdn.microsoft.com/vfoxpro/prodinfo/new.asp

      http://www.hallogram.com/foxfire/

      Maxwell

    • #3562542

      Add user account to WinNT with a program

      by zlatin zlatev ·

      In reply to Add user account to WinNT with a program

      This question was auto closed due to inactivity

Viewing 15 reply threads