Create a new User Account

  • Thread starter Thread starter Hudson Gevaert
  • Start date Start date
H

Hudson Gevaert

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
 
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]
 
That is awesome!! I figured that it had to be an api call
I just could not find the right one.
 
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
 
Back
Top