Re: How to get user's full name using HttpContext.Current.User

Discussion in 'ASP .Net' started by Mike Newton, Jul 23, 2004.

  1. Mike Newton

    Mike Newton Guest

    Allen Davis wrote:
    > I have a need to store the full name of the current Active Directory user of my ASP.NET application when inserting and updating records in my SQL database. (IIS is using Windows auth only, the app is not impersonating and the ASPNET account is mirrored on the SQL server.) I haven't been able to find good source material for this yet. Can someone help point me in the right direction?
    >
    > I'm also hunting for good documentation about uploading and returning PDF documents from SQL through ASP.NET. Recommendations here would also be much appreciated.
    >
    > Thanks


    You can get the full name of the user from the AD, using LDAP, if the
    user name is stored in AD. Otherwise, you're just going to get the
    Login name.

    You probably want to use this http://support.microsoft.com/?kbid=221606
    as a resource for ldap searches. It's pretty easy to construct an
    application that lists all nodes in your LDAP (AD) directory.

    A typical search string that you'd want to use would look something like...

    (&(sAMAccountName=LOGONUSER)(objectClass=user))

    That would get you the AD node, then you just have to retrieve the name
    property.

    As for the uploading / returning PDF's, I would use byte arrays. You
    can use blob fields in SQL Server to store that stuff, but I prefer
    using the server's file system (you can easily access the files that
    way) and earmarking it with an ID that is assigned by the database.
    Mike Newton, Jul 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Bart
    Replies:
    4
    Views:
    27,776
    Andrea D'Onofrio [MSFT]
    Dec 18, 2003
  2. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,597
    Steve C. Orr [MVP, MCSD]
    Jul 23, 2004
  3. Replies:
    10
    Views:
    3,468
    Kiran_S_Rao
    Dec 8, 2004
  4. nalbayo
    Replies:
    2
    Views:
    5,479
    Bruce Barker
    Nov 11, 2005
  5. Tony

    Dim context As HttpContext = HttpContext.Current

    Tony, Mar 2, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    299
    Teemu Keiski
    Mar 3, 2004
Loading...

Share This Page