General discussion
-
CreatorTopic
-
December 8, 2000 at 1:08 am #2093264
Add user account to WinNT with a program
Lockedby zlatin zlatev · about 22 years, 9 months ago
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 FOXTopic is locked -
CreatorTopic
All Comments
-
AuthorReplies
-
-
December 8, 2000 at 1:31 am #3869940
Add user account to WinNT with a program
by syscokid · about 22 years, 9 months ago
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 -
December 10, 2000 at 12:01 am #3869338
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
In reply to Add user account to WinNT with a program
See above
-
-
December 9, 2000 at 11:45 pm #3869341
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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 -
December 9, 2000 at 11:46 pm #3869340
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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 -
December 11, 2000 at 8:38 am #3870470
Add user account to WinNT with a program
by kent.manley · about 22 years, 9 months ago
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
-
December 24, 2000 at 12:48 am #3866323
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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.
-
-
December 11, 2000 at 10:41 am #3870407
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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
-
December 13, 2000 at 2:07 am #3868775
Add user account to WinNT with a program
by maunteljw · about 22 years, 9 months ago
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.
-
December 24, 2000 at 12:48 am #3866324
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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.
-
-
December 13, 2000 at 8:05 am #3868606
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
In reply to Add user account to WinNT with a program
Well I’m going to check the NT Resource kit.
-
December 24, 2000 at 12:58 am #3866321
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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 -
December 25, 2000 at 12:08 pm #3867701
Add user account to WinNT with a program
by kent.manley · about 22 years, 9 months ago
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
-
December 29, 2000 at 10:14 pm #3871777
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
In reply to Add user account to WinNT with a program
Poster rated this answer
-
-
December 29, 2000 at 3:15 am #3761839
Add user account to WinNT with a program
by remeltdb · about 22 years, 9 months ago
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-
December 29, 2000 at 10:09 pm #3871778
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
In reply to Add user account to WinNT with a program
See above comments
-
-
December 29, 2000 at 10:38 pm #3871775
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 9 months ago
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). -
January 5, 2001 at 12:54 am #3878136
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 8 months ago
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 EXEcutables5. 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 -
February 10, 2001 at 11:19 am #3842817
Add user account to WinNT with a program
by zlatin zlatev · about 22 years, 7 months ago
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 -
August 21, 2001 at 3:36 am #3724624
Add user account to WinNT with a program
by jereg · about 22 years, 1 month ago
In reply to Add user account to WinNT with a program
Please close the question.
-
November 19, 2001 at 5:59 pm #3562543
Add user account to WinNT with a program
by zlatin zlatev · about 21 years, 10 months ago
In reply to Add user account to WinNT with a program
The question was auto-closed by TechRepublic
-
-
November 14, 2001 at 12:13 pm #3561715
Add user account to WinNT with a program
by maxwell edison · about 21 years, 10 months ago
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
-
November 19, 2001 at 5:59 pm #3562544
Add user account to WinNT with a program
by zlatin zlatev · about 21 years, 10 months ago
In reply to Add user account to WinNT with a program
The question was auto-closed by TechRepublic
-
-
November 19, 2001 at 5:59 pm #3562542
Add user account to WinNT with a program
by zlatin zlatev · about 21 years, 10 months ago
In reply to Add user account to WinNT with a program
This question was auto closed due to inactivity
-
-
AuthorReplies