Questions tagged [principalcontext]

PrincipalContext class is part of the Microsoft .NET System Directory Services Account Management API. It encapsulates a server or a domain against which operations are performed. It is also used disambiguate the generic deprecated tag [tag:context].

PrincipalContext class is part of the Microsoft .NET System Directory Services Account Management API. It encapsulates a server or a domain against which operations are performed.

References

See the main documentation of this Class in in the MSDN library.

137 questions
0
votes
1 answer

How to check connection is made into a server when using PrincipalContext?

I need to change the password of a windows user in a machine which is connected in the same network. For that I am connecting the machine using PrincipalContextmethod, then get the specified user and finally change the password. private bool…
Nachikethas
  • 43
  • 1
  • 8
0
votes
1 answer

Changes in Active Directory in .NET c#

I am working on synchronization between internal .NET application between active directory for all users and groups. I am getting all users and groups from Active Directory and save these data in .NET application database. I am using…
user2054653
  • 3
  • 1
  • 3
0
votes
1 answer

How to create a Contact in Active Directory by extending UserPrincipal class?

I need to create a contact in Active Directory. I have a class that extends UserPrincipal. How do I use it to create a new contact? The code below throws PrincipalOperationException " The requested operation did not satisfy one or more constraints…
IT Hit WebDAV
  • 5,652
  • 12
  • 61
  • 98
0
votes
1 answer

GetMembers(true) don't list all users of membergroup

at first here is my code: PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "Domain"); GroupPrincipal gpx = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, "otheradmingroup"); List Members = new…
Fred
  • 5
  • 3
0
votes
0 answers

System.DirectoryServices.AccountManagement.PrincipalContext stores UserName and Password as plain-text in memory

If you use the System.DirectoryServices.AccountManagement.PrincipalContext constructor that takes a user name and password, that user name and (more disconcertingly) password are held internally as plain text strings in the object. Is there a way…
Jim
  • 4,910
  • 4
  • 32
  • 50
0
votes
0 answers

How can I reliably break PrincipalContext.ValidateCredentials

I've got an application that needs to be able to use the windows authentication for either the local machine or a domain. Previously, I was using PrincipalContext.ValidateCredentials, and it was working fine at first, then it started randomly…
nick
  • 2,833
  • 3
  • 34
  • 61
0
votes
1 answer

Either Negotiate or SimpleBind must be specified and they cannot be combined

i am trying to validate the credentials of a user against a active directory with a principalcontext but always get an error. I try to connect via ssl, because it is sensitive data, but it always give me the error in the headline. try { …
kurdy
  • 441
  • 4
  • 15
0
votes
0 answers

PrincipalContext fails under Windows 8

pc = new PrincipalContext(ContextType.Domain); Using this statement under Windows 8 produces the exception: The server could not be contacted. The user is already logged in to the machine when this is hit. It's running under WinForms. It works…
user3478586
  • 307
  • 4
  • 15
0
votes
1 answer

C# - Active Directory Group Filter

I'm using this code to filter the groups of my active directory domain: List result = new List(); using (PrincipalContext ctx = getContext()) { GroupPrincipal gp = new GroupPrincipal(ctx); PrincipalSearcher search =…
DanielD
  • 47
  • 1
  • 8
0
votes
1 answer

Accessing private web applications on server (running on server's network i.e. not publically accessbile on www ) through public interface

I have a scenario where 2 Web-Applications are running on Server's IIS and accessible on local network. I have to create a public interface (Web) for these websites so that users can access these from their homes. Work so far: Using…
Saeedses
  • 109
  • 1
  • 1
  • 8
0
votes
0 answers

Accessing the LDAP with PrincipalContext to a public server

I am having issues connecting to a public LDAP using PrincipalContext. I can get directory entry working fine: string sDomain = "LDAP://ldap.itd.umich.edu:389"; string sDefaultOU = "ou=System Groups,ou=Groups,dc=umich,dc=edu"; string sServiceUser =…
0
votes
1 answer

PrincipalContext is not getting the latest user roles from active direcory

I have a custom role provider for an ASP.NET MVC site which is retrieving the roles for a user using a PrincipalContext as below. This works fine, except there is a long delay between changing groups in Active Directory and it appearing in the…
0
votes
1 answer

Error with UserPrincipal Getauthorizationgroups

Error1: An operations error occurred. Error2: While trying to retrieve the authorization groups, an error (110) occurred. public static bool CheckGroupMembership(string userID, string groupName, string domain) { bool isMember = false; …
billsecond
  • 612
  • 3
  • 21
  • 50
0
votes
1 answer

System.DirectoryServices.AccountManagement PrincipalContext impersonation to create new user

In Sharepoint (or any ASP.NET web application) I want to have a function to create AD users. I'm using System.DirectoryServices.AccountManagement for this task, but I'm getting into trouble. Here is my code: using (var pc = new…
0
votes
1 answer

How to get the users domain to create a principalcontext asp.net

Using .Net 4.0 The line of code to create the PrincipalContext is: PrincipalContext context = new PrincipalContext(ContextType.Domain, "domain"); A while back I saw a code snippet where you don't have to specify the domain name but instead use a…
murisonc
  • 135
  • 1
  • 8
1 2 3
9
10