Re: getting info from active directory
From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 04/23/04
- Next message: Jeff Johnson [MVP: VB]: "Re: Start-Stop-Detect services running."
- Previous message: Billy: "Re: Call a subroutine"
- In reply to: Paras Wadehra: "Re: getting info from active directory"
- Next in thread: Paul Clement: "Re: getting info from active directory"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Apr 2004 09:07:21 -0400
Actually, to be accurate GetUserName returns the user name of the current
thread. This is the normally the name of the user currently logged onto the
system, but if the thread is impersonating another client it returns the
user name of the client that the thread is impersonating. I suspect
<educated guess-mode on> this is only of concern if the app is run as a
service, or possibly if an impersonation call is used (ie to perform a task
as the administrator).
-- Randy Birch MVP Visual Basic http://vbnet.mvps.org/ Please respond only to the newsgroups so all can benefit. "Paras Wadehra" <paraswadehra@Please_Remove_This_Hotmail.com> wrote in message news:#Hxev7KKEHA.3924@tk2msftngp13.phx.gbl... : The following function will work if you want to fetch the username of the : person logged into Windows (Just call the UserName function): : : : Public Function UserName() As String : : Dim cn As String : Dim ls As Long : Dim res As Long : : cn = String(1024, 0) : ls = 1024 : res = GetUserName(cn, ls) : If res <> 0 Then : UserName = Mid(cn, 1, InStr(cn, Chr(0)) - 1) : Else : UserName = "" : End If : : End Function : : -- : Paras Wadehra : : You One Stop Entertainment Guide - http://www.paras.2ya.com/ : : "Andre" <agibson_@hotmail.com> wrote in message : news:675F9D96-C04E-46AC-BC0F-D27D7EA77CC2@microsoft.com... : > hi all : > : > Does anyone know where I can find a snippet of code the explains how I can : pull info from active directory? : > : > Thanks : > : > : :
- Next message: Jeff Johnson [MVP: VB]: "Re: Start-Stop-Detect services running."
- Previous message: Billy: "Re: Call a subroutine"
- In reply to: Paras Wadehra: "Re: getting info from active directory"
- Next in thread: Paul Clement: "Re: getting info from active directory"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|