Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3595104
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:48:28+00:00 2026-05-18T19:48:28+00:00

I am trying to get the full name of a given user from active

  • 0

I am trying to get the full name of a given user from active directory.
This code works on my PC but when I put it on the server it throws exception:

The network path was not found.

The code is:

DirectoryEntry obDirEntry = null;
        try
        {
            obDirEntry = new DirectoryEntry("WinNT://" + "domain" + "/" + Environment.UserName);
            System.DirectoryServices.PropertyCollection coll = obDirEntry.Properties;
            object obVal = coll["FullName"].Value;
            Response.Write(obVal);
        }
        catch (Exception ex)

        {
           Response.Write(ex.Message);
        }

Any idea how to fix so it would work on the server also? Or maybe some other way I can get the full name of a given user name? Do I need to use LDAP instead somehow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T19:48:29+00:00Added an answer on May 18, 2026 at 7:48 pm

    There can be many issues here is what I found out

    1. Your new Directory object is pointing to WINNT I guess you need to use LDAP address for this one i.e.

      new DirectoryEntry("LDAP://" + sADServer + "/" + sNewOUPath, sADUser, sADPassword, AuthenticationTypes.Secure);

    2. In your webserver you need to change the user in your App Pool, and that user should have the proper rights to AD

    3. You can also edit your web.config to do <identity impersonate="true" /> and mage sure that the one that runs the page on the web server has the proper permission to AD

    for a full implementation referenc of AD refer to this one http://anyrest.wordpress.com/2010/02/01/active-directory-objects-and-c/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get FB user's full name using the access_token. I have
I am trying to get an attribute value from an XML file, but my
I am trying to setup my PowerShell command, so the Get-Help -full will show
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes
Trying to get this expression to work, can someone look at it and tell
I have given up tryng to figure out the reason of this issue, but
I have this code I been working on but I'm having a hard time
Hi I'm trying to get my onblur and onfocus functions to work but they
I've been trying to get this really simple example of using AJAX with JQuery
I'm trying to do something similar to this question , but it's a bit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.