Anyone have code to add NT users and groups. I've tried calling netapi32.dll functions but am having problems. So if anyone has already accomplished this, you would save me a lot of work. Thanks in advance.
Not groups, and if you need specific names, I can't offer that either, but I have a little app that will add/remove as many test users as you tell it to. You enter an integer (say 75) hit Add and "whamo!" you have 75 NT users.
There are NT shell commands to perform these tasks. It's the easiest way to go. Let me look through some of my old scripts to find this. Hopefully I will post another reply with the answer.
OK, I'm back...
the following command line will add a user...
NET USER username password /ADD
to delete a user from a domain...
NET USER username /DELETE /DOMAIN
Of course, you can only do this if the logged in user has the priveleges.
In any case, look up the NET commands, there's a lot more that it can do. There's a good book out there on NT shell commands. It's published by MacMillan Technical publishing.