Solved

How does NetUserGetInfo() get it's info?

Posted on 2002-04-03
3
273 Views
Last Modified: 2013-12-03
Hi I'm having some problems here with user authentification. Our app uses NetUserGetInfo()to get the info about the current user (home dir, home path and of course user name). But I checked some documentation and couldn't find from what it builds up it's information (if it's even accessible to us) because it returns me a wrong path and I don't know where to change the info so it will get it correctly.

A solution I was proposed was that the conflict was with the /etc/passwd file from cygwin where the network paths are read. But the solution only worked randomly and now fails so obviously it's not the final solution.

So if anyone has any info on how NetUserGetInfo() gets it's info it'd be appreciated.

Rich.
0
Comment
Question by:mannycalaveras
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6915669
'NetUserGetInfo()' obtains the information from the SAM database, that is where NT/W2k stores it's account information (either locally or on a DC). The info it returns mainly is the one eneterd via the user manager.
0
 
LVL 1

Author Comment

by:mannycalaveras
ID: 6916094
Thanks a lot!

But would you happen to know how information are built into the database? My sys admin wrote part of the code that gets home dire for the user and it's also a nice coincidence that he also created the accounts on the current pc (with 2k) but he says he did not set the home directory himself. The info must come from somewhere else but where? It's not that important since at least we can go change it in the user accounts but I wonder if it's not going to be changed back in some way (*).

* It's because it was working earlier today and I saw that I left a trace in the code that looks for the user's home directory and removed it and recompiled and did not want to work after that.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6916107
Well, what exactly is the difference (and your environment)? HOMEPATH e.g. is an environment variable that can be changed, whereas 'NetUserGetInfo()' queries the data that is used to set up the users profile.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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