.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Active Directory login

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
We will put the active directory logon when the user access the website, the user needs to fill in his user name and password.How do we store/get the details of the logon user once the user is logged in?

View Complete Post

More Related Resource Links

Create SQL Login that utilized Active Directory

Hello SQL Guru, I’m newbie to create SQL Login that utilized Active Directory. I have a SQL Server 2008 Enterprise edition 64-bits that runs in Window Server 2008 R2 Standard Edition 64-bit operating Systems. I configured  the SQL Server 2008 with Window Authentication. Then, I login with built-in Administrator account into computer and connected to my SQL Server 2008.  e.g: Object Explorer displayed COMPUTER NAME\Database Instance Name (SQL Server 10.0.2531 – COMPUTER NAME\Admin Account) Then, I created SQL login on the following: USE AccountingDatabase;GO CREATE USER  DomainName\User Name FOR LOGIN DomainName\User NameGO EXEC sp_addrolemember N’db_datareader’, N’DomainName\User Name’GO I tested it out and the specific login still did not have an access to specific database instance  e.g: “AccountingDatabase” Also, I did not see the “User Mapping” under properties checked/assigned to those specific user. Can anyone help and give me light on best practice. Thanks,Edwin

Small site embedded login validating against Active Directory and redrecting to SharePoint site


I am only finding pieces of this information. 

Challenge: Have a standard page with a login box in the corner that is exposed on the web.  The login will validate an employee against AD and also redirect them to a site collection.

I have found information on claims based authentication and the AD Membership provider.  I have also found information on form based login pages.  Most of these examples though just modify the SharePoint form login.  I want to create just a small login box on a page that is already created.  The one thing that I can't seem to find any really solid information on is the redirect to a site collection.

Can anyone tie all of this together for me?  Am I using the correct terminology and heading down the right path.

Any help is greatly appreciated.

Active Directory Authentication with Login Control ASP.Net 3.5 or 4


Hello, I am trying to follow instructions on how to create a login page that tests against active directory.  My issue is all of the tutorials seem to be written for ASP.NET 2.0.  When I try to follow them I cannot get them to work.  Does anyone have any tutorial or information for .NET 3.5 or 4.0?


changing active directory login name

So the guys at my company have been changing the AD login names for women that get married. For example Jenny Smith got married to Bob Right, AD\jsmith changes to AD\jright.  This doesn't cause any problems until we changed servers and used microsoft's login transfer script.  It scripts out Jenny's login as AD\jsmith, and then when you run the script it says:

Msg 15401, Level 16, State 1, Line 3
Windows NT user or group 'AD\jsmith' not found. Check the name again.

I know someone else has had to deal with this, is this just a bug?

also if i were to add AD\jright when AD\jsmith is already on the server it says AD\jright is already added to the security.

how to login in my portal using the user's username and password in active directory


i have a username and password in my portal... i want to connect to the active directory to verify the username and password of the user?

using c# .net

anyone can help me?

Login authentication using Active Directory for ASP.NET applications

This article explains how to authenticate the users while login into asp.net application against active directory in a simple way.

How to set SearchRoot Path in Active Directory in this scenario


How to set SearchRoot Path in Active Directory in this scenario:

Functionality: We have scenario that 1<sup>st</sup> hit one LDAP server with some 'fixed user name' &' fixed password ' and filter data with specific User name(which given by user) getting 'User dn'.

After that we hit Next LDAP server based on the 'User dn' getting from 1<sup>st</sup> server.

(So, in my case 1<sup>st</sup> LDAP server works like as Load balancing server but functionalitywise it is different)


active directory exception unusual behaviour


i have a small problem
i want user names from active directory for an auto completer type of service
the method is always throwing an exception 
"searcher.FindAll()' threw an exception of type 'System.DirectoryServices.DirectoryServicesCOMException' System.DirectoryServices.SearchResultCollection 

Active Directory and .NET: paging the search result

Hi everybody!

I have a question about Active Directory in .NET
For my project I need to fetch results from Active Directory search page by page, because later I would need to bind it to the pageable DataGrid.

I tried to use .NET library DirectoryServices for that, but paging provided by this library is transparent to the user and is used only to increase the efficiency of searching, when results are too big. I.e. I cannot tell the DirectorySearcher to give me first page, then the next or previous page, it returns me all resulting pages in one bundle.

However, what I need is to explicitely get page after page directly from the AD searcher and to be able to go at least one page forward or backward.

The solution with copying all results to the DataBase and then do the paging is not accepeted by the clent, since it is too inefficient. And since it's a Web app, I cannot keep results in memory either.

I found some hints about COM Interface, but I could not find good and detailed examples or explanations. I aslo found this line of code: DirectoryServices.Interop.IDirectorySearch.ExecuteSearch(), but I don't know which libraries should i add to be able to compile this code.

If somebody could help me out with that problem, any suggestion is welcome, 'cause this issue is eating me alive :)

Thank you!

Error on Display user's fullname using Active Directory in asp.net using vb.net



wi As System.Security.Principal.WindowsIdentity =  _System.Security.Principal.WindowsIdentity.GetCurrent()



Dim a As String() = HttpContext.Current.User.

Getting list of users reporting from specific Manager from Active Directory


Dear All,

I am have requirement like displaying all the user information reporting to specific manager from Active Directory.

Please help me regarding this.



List Users from Active Directory


When i try to List the users from Active directory, i get this exception.

Error while processing.System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll()

The code i used is :

DirectoryEntry de = new DirectoryEntry(_path);DirectorySearcher deSearch = new DirectorySearcher();

deSearch.SearchRoot =de;

deSearch.Filter = "(&(objectClass=user) (cn=" + UserName +"))";

SearchResultCollection results = deSearch.FindAll();

 But the DirectoyEntry method is getting validated if i use the overloaded method : DirectoryEntry(_path, domainAndUsername, password);

Please advice me.

AD FS 2.0 in Identity Solutions: Using Active Directory Federation Services 2.0 in Identity Solution


This article explains how you can use Active Directory Federation Services (AD FS) 2.0 to claims-enable Windows Communication Foundation (WCF) services and browser-based applications. The focus is on the token issuance functionality in AD FS 2.0. You'll find out how to use AD FS 2.0 as an identity provider; set up an AD FS 2.0 security token service (STS) to interact with WCF; federate AD FS 2.0 with your custom STS or another AD FS 2.0; enable Web single sign-on and federation with WS-Federation and SAML 2.0 protocols; and externalize authentication logic through Visual Studio. You'll come away appreciating how AD FS 2.0 and Windows Identity Foundation make programming identity solutions in Windows less of a chore.

Zulfiqar Ahmed

MSDN Magazine November 2009

Security Briefs: Active Directory Cache Dependencies


If you're not taking advantage of Active Directory, you should be. Learn the benefits from Keith Brown.

Keith Brown

MSDN Magazine July 2007

Single Sign-On: A Developer's Introduction To Active Directory Federation Services


Use Active Directory Federation Services to allow other organizations to use your Web applications without the need for you to grant access explicitly.

Keith Brown

MSDN Magazine November 2006

Got Directory Services?: New Ways to Manage Active Directory using the .NET Framework 2.0


System.DirectoryServices is a managed code layer on top of Active Directory Service Interfaces, and you can employ it to better manage Active Directory from your code. Here Ethan Wilansky helps you get started.

Ethan Wilansky

MSDN Magazine December 2005

Active Directory and ASP.net VB




Real newbie question :-)


I currently get the current logged on user info from AD by using :

Label1.Text = Page.User.Identity.Name.ToString
However now I need to get the following :
Label2 = (this must show the current logged on user's email address)
Label3 = (this must show the current user's manager)

any help would be appreciated

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend