Solved

Accessing NT Account Info

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy a row 12 76
VBA: Personal Macro Retain/Highlight/Remove values in a selected column 4 37
VB6 ListBox Question 4 63
MS SQL Update query with connected table data 3 81
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.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 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