473,804 Members | 2,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get full name of user

I am trying to get the full name of a user not logged into a network on
Windows 2000/XP. I know how to get the user name (cclement), but how do I
get the full display name (Chris Clement) as it is displayed in the start
menu in Windows XP?

Any help is appreciated.

Chris
Nov 15 '05 #1
2 6736
Chris,

You can call the GetUserNameEx API function through the P/Invoke layer
to get the display name. For the NameFormat parameter, you can pass the
value of NameDisplay from the EXTENDED_NAME_F ORMAT enumeration (it has a
value of 3).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Chris Clement" <ch**********@o nlyonnewsgroup. com> wrote in message
news:OJ******** ******@tk2msftn gp13.phx.gbl...
I am trying to get the full name of a user not logged into a network on
Windows 2000/XP. I know how to get the user name (cclement), but how do I
get the full display name (Chris Clement) as it is displayed in the start
menu in Windows XP?

Any help is appreciated.

Chris

Nov 15 '05 #2
Thanks for the reply, Nicholas. Do you know of any resource that can show
me how to use APIs like this in a c# program. Or could you give me an
example of its usage. thanks again.

Chris

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:Oc******** **********@TK2M SFTNGP11.phx.gb l...
Chris,

You can call the GetUserNameEx API function through the P/Invoke layer
to get the display name. For the NameFormat parameter, you can pass the
value of NameDisplay from the EXTENDED_NAME_F ORMAT enumeration (it has a
value of 3).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Chris Clement" <ch**********@o nlyonnewsgroup. com> wrote in message
news:OJ******** ******@tk2msftn gp13.phx.gbl...
I am trying to get the full name of a user not logged into a network on
Windows 2000/XP. I know how to get the user name (cclement), but how do I get the full display name (Chris Clement) as it is displayed in the start menu in Windows XP?

Any help is appreciated.

Chris


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1378
by: RCIC | last post by:
Trying to get a user's full name using ADSI. It works in our Win2000 Active Directory but fails when I try to get a user's full name from a trusted WinNT domain. The error is "Cannot create ActiveX component." Here's my code Dim myObject As Objec myObject = GetObject("WinNT://" & strDomain & "/" & strUsername & ",User" Return myObject.FullName( Any ideas why Also: I tried using a LDAP path (LDAP://cn=Username, dc=Domain) and that...
4
9876
by: Mike | last post by:
Greetings, I am writing an Intranet application in ASP.NET using VB.NET. I am obtaining the username of the user with: uName = User.Identity.Name, which is in the form of DOMAIN\username. I then use substring to parse out just the username. What I am trying to accomplish is getting the full name of the user by doing a search in Active Directory, but I am failing at every turn. This code:
1
2194
by: Jordan Bruce | last post by:
******************************************************* ONTARIO CANADA INFORMIX USER GROUP (OCIUG) http://www.iiug.org/ociug NEXT MEETING: WEDNESDAY, JULY 14 ******************************************************* Dear OCIUG member, Our next meeting is an all-day event this coming Wednesday, July 15 at the IBM training facility in Markham (directions below). Continental
15
11561
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to MSACCESS.EXE, tries them all, takes the first one it finds, and dies if none is found. Seems to me like at some time or another I was able to clone this .BAT file and implement it with no path. Something about MSACCESS being a registered application.
0
1900
by: Rob | last post by:
I need to allow a user with the default "Full Data User" permissions on the front-end database to relink to a table in a backend to which he has the same permissions. (I'd like to do read, update, insert, delete, which are the DEFAULTS for a "Full data user", but just so you know I have also added "Administrator" for this group in front and backends, just to try and figure out the problem and it didn't help). Anyway I cycle through the...
2
582
by: Jesper | last post by:
Hi, I don't know if its possible, but I would like to get the full name of the user. Using string name = System.Environment.UserName; only gives me the login name of the user - however, when I push the windows start button (in XP) , my full name is shown at the top of the start pop-up. Is it possible to query for this full name value somewhere??
7
1911
by: Jason Reichenbach | last post by:
I've GOT to be missing something painfully obvious, here... I need to programmatically get the full human name of the current user on a local system, the same system upon which the app is running. Using C#.NET MSDEV2003. OS will be Win2K or WinXP. I've found numerous ways to get the user name, but have yet to find the way to get the human name.
2
2429
by: Bill nguyen | last post by:
I learned that I can use system.environment.username to get user login name. How can I get user full name/description from Active Directory or GAL? Thanks a million. Bill
3
7186
by: Vibhu | last post by:
Hello All, I have a input box on the HTML page with the type set to file. What I want is that when the value changes in the file textbox, it should give me the full file path. I have even tried passing the value to a hidden control but all it does is passes only the File Name and not the file path. How do I go about it. I tried checking GMAIL service (Compose Mail) but all I could get is that they are passing the window and the file...
2
21138
by: m19peters | last post by:
We have a script that I had to rework a little bit for 2005 that does a full backup for every database on the server... For some reason on some nights the script does not backup all databases... Its like it skips over it for some reason... Output of the script below on the night in question was: Executed as user: NT AUTHORITY\SYSTEM. master (Message 0) Status is ONLINE dbname / dbdevice = master / SQLBUmaster (Message 0) Processed...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.