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

  • Home
  • SEARCH
  • 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 140331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:35:44+00:00 2026-05-11T07:35:44+00:00

I have an intranet server on a Windows domain (server is Windows 2003, IIS6,

  • 0

I have an intranet server on a Windows domain (server is Windows 2003, IIS6, NTFS permissions). It is on the domain Domain01. I have users from two domains in the same forest that access this intranet: Domain01 and Domain02 (DCs also running Windows 2003). Currently, the users are required to login by entering either: Domain01\username or username@Domain01

My users are completely and thoroughly confused by having to enter the domain each time they log in. Is there any way to simply allow them to log in by entering just their username and password WITHOUT the domain? For example, have the server try Domain01 by default, and if the login fails to try Domain02?

NOTE: I would like to do this via IIS or server settings if possible, rather than programmatically (for reference, I am using ASP.NET 2.0).

  • 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. 2026-05-11T07:35:44+00:00Added an answer on May 11, 2026 at 7:35 am

    Yes. Usually what I do is do a global catalog search using the supplied user name as the sAMAccountName. Doing this with a PrincipalSearcher requires getting the underlying DirectorySearcher and replacing it’s SearchRoot. Once I find the corresponding user object I extract the domain from the user object’s path and use that as the domain for the authentication step. How you do the authentication varies depending on what you need it to do. If you don’t need impersonation you can use PrincipalContext.ValidateCredentials to make sure that the username/password match using a PrincipalContext that matches the domain of the user account that you previously found. If you need impersonation check out this reference.

    // NOTE: implement IDisposable and dispose of this if not null when done. private DirectoryEntry userSearchRoot = null; private UserPrincipal FindUserInGlobalContext( string userName ) {     using (PrincipalSearcher userSearcher = new PrincipalSearcher())     {         using (PrincipalContext context                  = new PrincipalContext( ContextType.Domain ))         {             userSearcher.QueryFilter = new UserPrincipal( context );             DirectorySearcher searcher                  = (DirectorySearcher)userSearcher.GetUnderlyingSearcher();              // I usually set the GC path from the existing search root             // by doing some string manipulation based on our domain             // Your code would be different.             string GCPath = ...set GC path..              // lazy loading of the search root entry.               if (userSearchRoot == null)             {                 userSearchRoot = new DirectoryEntry( GCPath );             }              searcher.SearchRoot = userSearchRoot;             using (PrincipalContext gcContext =                      new PrincipalContext( ContextType.Domain,                                            null,                                            GCPath.Replace('GC://',''))             {                 UserPrincipal userFilter = new UserPrincipal( gcContext );                 userFilter.SamAccountName = userName;                 userSearcher.QueryFilter = userFilter;                 return userSearcher.FindOne() as UserPrincipal;             }         }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer No. GetMessage returns messages on the current thread's input queue.… May 11, 2026 at 11:05 am
  • added an answer Do you want to execute the code in eg2.py when… May 11, 2026 at 11:05 am
  • added an answer After a little messing I found it. The type name… May 11, 2026 at 11:05 am

Related Questions

In an Intranet environment, I have an FTP server set up for publishing files
I have an intranet application that needs contact information for various locations on our
I have an asp.net intranet application for booking jobs and a phone index. Now
For the last couple of months I have been writing an intranet site for
I have a PHP web application on an intranet that can extract the IP
I have a contract in the offering from a client to develop an intranet
I have a relatively simple site that I'm working up for an intranet environment.
I have an absolutely positioned div containing several children, one of which is a
I have an array in Perl: my @my_array = (one,two,three,two,three); How do I remove
I have an images folder with a png in it. I would like to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.