473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Create a new User Account

Hi, I was wondering if anybody new how to create a windows
xp user account from within VB code. I was also curious
how to list all the user accounts on a machine.
Thanks,

Hudson Gevaert
Nov 20 '05 #1
3 2260
NetUserAdd
NetUserEnum

You'll need to use P/Invoke (or the VB Declare statements). The functions
are in Netapi32.dll
Also note that your program needs to run with an Admin/owner account for add
to work.
Specify null (String.Empty) for the server name to create a Local user
(rather than a network/domain user).

-Rob Teixeira [MVP]

"Hudson Gevaert" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
Hi, I was wondering if anybody new how to create a windows
xp user account from within VB code. I was also curious
how to list all the user accounts on a machine.
Thanks,

Hudson Gevaert

Nov 20 '05 #2
That is awesome!! I figured that it had to be an api call
I just could not find the right one.

-----Original Message-----
NetUserAdd
NetUserEnum

You'll need to use P/Invoke (or the VB Declare statements). The functionsare in Netapi32.dll
Also note that your program needs to run with an Admin/owner account for addto work.
Specify null (String.Empty) for the server name to create a Local user(rather than a network/domain user).

-Rob Teixeira [MVP]

"Hudson Gevaert" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl...
Hi, I was wondering if anybody new how to create a windows xp user account from within VB code. I was also curious
how to list all the user accounts on a machine.
Thanks,

Hudson Gevaert

.

Nov 20 '05 #3
I don't suppose you know how to collect network
information, like in the network places window?
Create it so that it would display workgroups and allow
you to click to view the computers in the selected
workgroup etc.
I was thinking it also was an api call that would return
an enumeration of some sort. If that is the case then how
would I represent that in a listview?

thanks again for any help
-----Original Message-----
NetUserAdd
NetUserEnum

You'll need to use P/Invoke (or the VB Declare statements). The functionsare in Netapi32.dll
Also note that your program needs to run with an Admin/owner account for addto work.
Specify null (String.Empty) for the server name to create a Local user(rather than a network/domain user).

-Rob Teixeira [MVP]

"Hudson Gevaert" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl...
Hi, I was wondering if anybody new how to create a windows xp user account from within VB code. I was also curious
how to list all the user accounts on a machine.
Thanks,

Hudson Gevaert

.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
2
by: Jim G | last post by:
I have two tables: TestA and TestB. Both tables have 3 fields: ID, Name, and RunDate. I need to create a query which will join the two tables first on Name but then I need to match up the...
2
by: Keith Jakobs, MCP | last post by:
Greetings: I had seen several posts around the Internet about this issue from a few months back, but have been unable to find a resolution ... I have a user who is trying to get started with...
2
by: Vincent Nguyen | last post by:
Hi, I have problem create exchange 2000 mailbox using CDOEXM in my Web Service application. The error I got was "Catastrophic failure". Here is the code that I have: DirectoryEntry user =...
10
by: robwharram | last post by:
Hi, I'm quite frustrated in the fact that I can't even display a simple "Hello World" message on .Net. I've been through all of the groups and searched all over the place and haven't been able...
3
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim...
2
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
5
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
16
by: Mich | last post by:
Hi, i'm building an web application for anonymous users. They can take a look in the website, nothing more. In order to perform other actions, the anonymous user must be logged. So i create an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.