Once you have the logged on user name, you can use the NetGerUserInfo function to get the full name from the NT domain controller. You need to use the level 2 structure to fetch this information.
The following code sample is from MSDN:
#include <windows.h>
#include <lm.h>
#include <stdio.h>
BOOL GetFullName( char *UserName, char *Domain, char *dest )
{
WCHAR wszUserName[256]; // Unicode user name
WCHAR wszDomain[256];
LPBYTE ComputerName;
struct _SERVER_INFO_100 *si100; // Server structure
struct _USER_INFO_2 *ui; // User structure
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.