Programming Windows NT with Visual Basic
Since getting my own home network this summer and playing around with NT Server, I have found many limitations on client/server machines for carrying out simple tasks. The API Viewer does not list any Winndows NT Networking API calls, but they are out there.
I dropped in on Inquiry.com's Ask the NT Pro (LJ Johnshon) to see what they had for VB. I found quite a few examples, along with a few of my own, and I have wrapped them up into an easy to use class module called CNetworkNT.
CNetworkNT exposes eight methods for you to use NT from within your VB apps. These methods include:
AddUser - Adds a new user to the current domain
AddUserToLocal - Adds a new user to the local group
ChangePassword - Changes a password for a user
GetDomains - Lists all the domains on the current network
GetLoggedOnUsers - Returns the state of all users on the network.
GetPrimaryDCName - Returns the Primary Domain Controller computer name
Login - Login a user to the network
SetServerInfo - Sets the comment of a server on the network
The problem is that the majority of these methods use API calls that call on the netapi32.dll which is not found on most Win 95 machines, therefore a lot of the calls need to be made from NT Server or Workstation.
Either way, I am sure that you will find this class useful, I certainly have. All the API Declares, constants and type structures have been included in the same class to make it a totally drop in class module.