473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DirectoryServicesCOMException encountered UserPrincipal.FindByIdentity(pc, userName)

I am trying to hook up with Active directory to get the Group of the user using System.DirectoryServices.AccountManagement.
When I am running the Application from VS2010 it Authenticate user and Display the Group as well.
But when I am browsing application from IIS 5.1 it showing error while checking the group.

“System.DirectoryServices.DirectoryServicesCOMExce ption: Logon failure: unknown user name or bad password.”

PrincipalContext pc = new PrincipalContext(ContextType.Domain, “TEST1″)
On Sentence
UserPrincipal.FindByIdentity(pc, userName);


Please find the code of GetPrincipalContect as given below.
Expand|Select|Wrap|Line Numbers
  1. public PrincipalContext GetPrincipalContext()
  2. {
  3.   PrincipalContext oPrincipalContext = new PrincipalContext(ContextType.Domain, “TEST1″);
  4.   return oPrincipalContext;
  5. }


Kindly provide some help.
Oct 6 '10 #1
0 1078

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Ghazan Haider | last post by:
I am posting this for the lack of a better newsgroup, and for the knowledge of people here, and because its only partially OT. We have a bunch of users with their computers at work. There are...
14
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the...
2
by: Pucca | last post by:
Where can I find pre-defined Error code like OBJECT_ALREADY_EXISTS (HRESULT) for the DirectoryServicesCOMException.ErrorCode? I need it for the try-catch coding. Thanks.
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
2
Steve Kiss
by: Steve Kiss | last post by:
Hi. I'm developping an website that uses the ASP.NET membership provider with Sql Server. The problem is I want to use the user's email address as a unique identifier instead of a username....
4
by: muzu1232004 | last post by:
i got the following Error message occurred while exporting: EXP-00008: ORACLE error 1455 encountered ORA-01455: converting column overflows integer datatype EXP-00056: ORACLE error 1403...
24
by: runway27 | last post by:
i have used the following code to validate the username it is working fineif( $username == "" || !preg_match("/^+(?:_+)?$/i", $username) ) { $error.="User name cannot be blank or has special...
2
by: shapper | last post by:
Hello, I know that only authenticated users has a UserName. In Anonymous users there is an ID. If I am not wrong when getting a profile of a user, if the user is authenticated the UserName is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.