Solved

Accessing NT Account Info

Posted on 1998-04-10
4
423 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 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