Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Userinfo

Status
Not open for further replies.

AndreasAuer

IS-IT--Management
Jan 14, 2001
25
AT
Hi
I want to get the Real Username of a Domainuser. I know, how to get the Loginname, but I need the real one. How can I do this??
I hope somebody can help me

greetz
Andreas
 
Andreas

Code:
txtRealName = Environ("Full")

hth
Scoty ::) "Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
 
Andreas, Scoty,

This doesn't seem to work for me. I don't know if it's because I am running Win2K or not, but there is no "Full" environment variable.

There are the usual others, like USERNAME, USERDOMAIN, USERDNSDOMAIN, etc - but no full name. Perhaps this is an environment variable which can be set at login, but is not necessarily required.

If you want to see which environment variables exist on your PC, try this:

1. Put a listbox (List1) and a command button (command1) on a form.

2. type the following code
Code:
Private Sub Command1_Click()
    Dim txtRealName As String
    Dim n As Integer
    For n = 1 To 255
        txtRealName = Environ(n)
        List1.AddItem txtRealName
    Next n
End Sub

HTH

Smasher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top