Solved

Accessing NT Account Info

Posted on 1998-04-10
4
419 Views
Last Modified: 2008-02-01
I need to access NT account info from a VB 5.0 App running on Windows 95.  I'm particularly interested in Fullname, Comment,  Home Drive, and Home Dir. I was able to get some of this info by calling netusergetinfo from the 16 bit netapi.dll using VB 4.0.  Is there a way to get this data using VB 5.0?  
0
Comment
Question by:dtday
  • 2
  • 2
4 Comments
 

Author Comment

by:dtday
ID: 1460965
Edited text of question
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1460966
The same 32 bit function is available in the netapi32.dll

The NetUserGetInfo function retrieves information about a particular user account on a server.
Security Requirements:
No special group membership is required to successfully execute NetUserGetInfo. This is a change from LAN Manager, which required membership in the Administrators or Account Operators local group to call this function at information levels above 0 (except for the user's own account, which could use level 11).
NET_API_STATUS NetUserGetInfo(
    LPWSTR servername,      
    LPWSTR username,      
    DWORD level,      
    LPBYTE *bufptr      
   );      
 
Parameters
servername
Pointer to a Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.

username
Pointer to a Unicode string containing the name of the user account on which to return information.

level
Specifies one of the following values to return the level of information provided.
Value      Meaning
0      Returns USER_INFO_0 structure pointed to in bufptr.
1      Returns USER_INFO_1 structure pointed to in bufptr.
2      Returns USER_INFO_2 structure pointed to in bufptr.
3      Returns USER_INFO_3 structure pointed to in bufptr.
10      Returns USER_INFO_10 structure pointed to in bufptr.
11      Returns USER_INFO_11 structure pointed to in bufptr.
20      Returns USER_INFO_20 structure pointed to in bufptr.
 
bufptr
Pointer to the buffer in which the data set with the level parameter is stored. The returned buffer should be deallocated using the NetApiBufferFree function.
 
Return Values
If the function is successful, it returns NERR_SUCCESS.
If the function fails, the return value is one of the following error codes.
Value      Meaning
ERROR_ACCESS_DENIED      The user does not have access to the requested information.
NERR_InvalidComputer      The computer name is invalid.
NERR_UserNotFound      The user name could not be found.

0
 

Author Comment

by:dtday
ID: 1460967
Microsoft in their infinite wisdom did not include the  netusergetinfo function in the Windows95 version of the NetApi32.dll, though it does exist in the NetApi32.dll for NT 4.0.  I need this to work on Windows 95.
0
 
LVL 8

Accepted Solution

by:
mrmick earned 200 total points
ID: 1460968
hmmm...  Check out:

Microsoft Knowledge Base
Article ID: Q125700
Title: "Windows 95 Support for Net Function Calls"
http://premium.microsoft.com/support/kb/articles/q125/7/00.asp
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now