Results 1 to 5 of 5

Thread: Getting current user's Full Name

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    1

    Getting current user's Full Name

    I know how to get the logged in user name, but how would one get the actual name associated with the logged in user?

    ex:
    username - domain\jdoe
    full name - john doe

    how does one get the full name?

  2. #2
    Lively Member
    Join Date
    Jan 2006
    Posts
    66

    Re: Getting current user's Full Name

    Do you mean like who the system is registered to? If not im not sure what you mean, if you already got the user name...

  3. #3
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Getting current user's Full Name

    What do you mean by full name? When you create an Account in Windows, you specify the user name and what level of access you want them to have and that's it. There is no full name saved.

    If you're talking about converting jdoe into John Doe... well that's impossible because that could also mean Jack Doe, Jammie Doe, etc... You also can't be sure a user name is the first initial and the last name (Mine is only my first name).
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Getting current user's Full Name

    When your part of a domain your user account has several fields and properties available that a local one doesnt have.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Getting current user's Full Name

    Quote Originally Posted by dannerbo
    I know how to get the logged in user name, but how would one get the actual name associated with the logged in user?

    ex:
    username - domain\jdoe
    full name - john doe

    how does one get the full name?
    You will have to WMI to get this information. Set a reference to System.Management.DLL and then try to use Win32_UserAccount Class to get the desired information.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width