Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Login Name

Posted on 2002-04-29
2
Medium Priority
?
171 Views
Last Modified: 2010-05-02
Hi All,
I was wondering what would be the best way to get the NT login names for users if I know there first name and last name. I was thinking about using ADSI. Is this a good solution.
Thank You,
Kent
0
Comment
Question by:kmurphy7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
iski2 earned 200 total points
ID: 6978268
Try using:

Dim uLst
Set uLst = GetObject("WinNT://DomainName")
uLst.Filter = Array("User")
For Each User In uLst
List1.AddItem User.fullname
Next
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 6978279
Here is the code we use to get the user's login name

Declare Function GetUserNameA Lib "advapi32.dll" (ByVal lpBuffer As String, nSize As Long) As Long


Public Function GetUserName() As String
Dim UserName As String * 255

Call GetUserNameA(UserName, 255)
GetUserName = Left$(UserName, InStr(UserName, Chr$(0)) - 1)
End Function

mlmcc
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question