Solved

Accessing NT Account Info

Posted on 1998-04-10
4
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses
Course of the Month7 days, 5 hours left to enroll

622 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