Questions tagged [userprincipal]

Encapsulates and exposes some principals or constructors of the active directory userprincipal class.

Encapsulates and exposes some principals or constructors of the active directory userprincipal class.

Link: UserPrincipal Methods

170 questions
0
votes
2 answers

How to set PermittedWorkstations to an user using UserPrincipal in C#

I have a system that creates, in realtime, an user in AD and prints a tag for credentials. That user is used by a person to navigate in the internet. Everything was ok until now. That user cannot log on company's computer, only on the proxy…
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
0 answers

how create 'Authentication Required' for URL?

For the download files from certain sites, you must ENTER your username and password in 'Authentication Required' window. How is this implemented? Like this picture: Authentication Reguired Window http://s9.uploads.im/sVCmz.png Use 'UserPrincipal'…
RezaNrzdh
  • 1
  • 1
0
votes
1 answer

UserPrincipal AccountLockoutTime always null

I'm accessing various properties for user objects in Active Directory. I have the below method which I wrote. It which works for all the properties except for AccountLockoutTime which always comes back as null. public…
Chris.ZA
  • 1,218
  • 1
  • 15
  • 30
0
votes
2 answers

Can i get Active directory users info such as email, Telephone & Manager using UserPrinciple

I have the following code inside my asp.net mvc5 web application:- List results = new List(); using (var context = new PrincipalContext(ContextType.Domain, ADServerName, ADusername, ADpassword)) using (var…
John John
  • 1
  • 72
  • 238
  • 501
0
votes
2 answers

Which security should I use?

I am making an intranet mvc app for in-house use. Only other guy in the shop is the server tech. I am told we have a domain controller and we use AD, every user is in groups. I'm pretty sure we use windows authentication (based on we have to log in…
BattlFrog
  • 3,370
  • 8
  • 56
  • 86
0
votes
1 answer

Getting extra ad attributes from UserPrincipal

I have the below code to get a user's full name by logon name: public View GetUser(string sUser) { View oView = new View(); oView.User = sUser.ToUpper(); using (PrincipalContext oPrincipalContext = new…
Espen
  • 3,607
  • 11
  • 48
  • 75
0
votes
1 answer

How to add Manager attribute on active directory by PrincipalContext using ASP.net,C#

I am creating user by PrincipalContext on active directory. I want to add some extra attributes like Location, Initials,EmployeeId and Manager. I can able to add Location, Initials and EmployeeId successfully by using UserPrincipalEx class. but i am…
Suryakavitha
  • 1,371
  • 5
  • 33
  • 49
0
votes
1 answer

How to cast from GroupPrincipal base to GroupPrincipalsEx

I have GroupPrincipal extension that adds several extensionAttributes: [DirectoryObjectClass("group")] [DirectoryRdnPrefix("CN")] public class GroupPrincipalsEx : GroupPrincipal { public GroupPrincipalsEx(PrincipalContext context) :…
Vojin
  • 33
  • 4
0
votes
1 answer

Exception when calling FindByBadPasswordAttempt

I'm trying the last time when my windows password was written incorrect. And to do it I use UserPrincipalSearcher: PrincipalContext pc = new PrincipalContext(ContextType.Machine); var v = UserPrincipal.FindByBadPasswordAttempt(pc, DateTime.Now,…
0
votes
1 answer

How to get list of AD username from first name or surname (from one input textbox)

Scenario: User enters a name (which could be either first name or surname) in the textbox and click the search button. System should return all the usernames (along with Full name) wherever the first or surname matches with existing AD…
PineCone
  • 2,193
  • 12
  • 37
  • 78
0
votes
1 answer

C#, UserPrincipal.FindByIdentity always throw exception: "Server sent a referer" or unknown 0x80005000

I spend a whole day and got nothing. I'm developing a web app that authenticate using domain user/password. The code is followed. the first half is ok, I can get output: "the user and pass is: True." Then, UserPrincipal.FindByIdentity throws error,…
JimZ
  • 1,182
  • 1
  • 13
  • 30
0
votes
1 answer

Issue Getting windows client display name in an .asmx service script in (VB) ASP.NET

I'm very new to ASP.NET and I've been struggling trying to get the username of the client sending requests to a web service script on the server side. After searching online I found two properties that supposedly gives the server page access to the…
pythonian29033
  • 5,148
  • 5
  • 31
  • 56
0
votes
0 answers

Add none UserPrincipal field to AD entry

I am trying to add a none UserPrincipal field to a small application, but I just cannot get it to work. I tried several ways to do this simple task, but I cannot get anything to work for me. I am trying to ADD a field called Company to be inserted…
TGarrett
  • 562
  • 4
  • 15
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…
1 2 3
11
12