NetUserGetInfo returns 1008 (GetLastError)  
Author Message

PostPosted: Visual C++ Language, NetUserGetInfo returns 1008 (GetLastError) Top


I am developing a dll which uses NetUserGetInfo to retreive the home directory of a Domain user.
NetUserGetInfo returns 1008 error code.

my usage of function:

The problem i was thinking was, The dll is launched by a local user(admin privilages) on a system which is in the same domain. SO may be the local user does not have enough permissions to use the NetUserGetInfo function to retreive the necessary information.

My questions:

1. Is it possible to provide enough permissions for the local-user to access domain users properties, How

2. The other alternate is to connect to domain-server with some power user and then use the NetUserGetInfo function. But I do not find suitable function to connect to domain server with a power user credentials in windows network management API(netapi32.lib)

Thanks for the help

Visual C++2  

PostPosted: Visual C++ Language, NetUserGetInfo returns 1008 (GetLastError) Top

If the problem is access, I suggest you create a new user which has access to the domain server, and launch (runas) the application with that uid.

The error you referenced doesn't strike me as something that indicates an access error, however. If you want more help, you should provide more information (paste the surrounding code).

Also, this forum is meant for C++ language questions, not general technology discussions (even though C++ is used). There are specific network newsgroups at, which may prove more helpful.