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
0 answers

How to set the owner of a file from a string variable

FileOwnerAttributeView FOAttr = Files.getFileAttributeView(VidFile.toPath(),FileOwnerAttributeView.class); System.out.println(FOAttr.getOwner()); UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); …
0
votes
3 answers

SamAccountName to UpperCase

Does the SamAccountName property of UserPrincipal not return a string? I'm trying to take the first character of my SamAccountName and convert it .ToUpperCase() but .ToUpperCase() is not available for SamAccountName private void…
BlueBarren
  • 321
  • 7
  • 24
0
votes
2 answers

Checking Active Directory Expire Dates

I have a program that runs some validations on objects in active directory and one of my checks is to see if the expiry date is set within a year. With a UserPrincipal object I can check the .AccountExpirationDate date to see if it has one but how…
BlueBarren
  • 321
  • 7
  • 24
0
votes
0 answers

DirectoryServices.AccountManagement UserPrincipal - The old password still works for 5 mins after change or reset the password

The password reset works fine and the user can log in with their new password, but their old password still works. My old password gets expire after 5 mins. The user is added in the Password Policy group. I tried one tried to stop validating the old…
0
votes
1 answer

ActiveDirectory Update a user getting UnauthorizedAccessException

When I attempt to update the Description of a user on the Domain Controller, I get the error UnauthorizedAccessException. I have validated the username and password I am using is in fact able to update the user. I logged in as the services…
Rick Runowski
  • 346
  • 3
  • 9
0
votes
0 answers

c# UserPrincipal GetGroups dont use SSL

I want to do Active Directory Operations over SSL and port 696 and use this test code: var domain = "server:636"; var domainPath = "DC=x,DC=y,DC=c"; var username = @"abc"; var userSearch = @"abc2"; var password =…
0
votes
1 answer

C# Active Directory - Query Unsuccessful Login Attempts

Is there a way to return a list of Active Directory login attempts using C#? For example, I would like to somehow return a list that contains the following DC Name Site User State Bad Pwd Count Last Bad Pwd PWD Last Set Lockout Time Essentially,…
Brian Mikinski
  • 123
  • 1
  • 10
0
votes
1 answer

Form Authentication - An operation error occured FindByIdentity

i have a form authentication: I have a page with my login and to check the credential I do: public static bool ValidateCredentials(string…
ayasha
  • 1,221
  • 5
  • 27
  • 46
0
votes
0 answers

Getting error "Server not operational" when using UserPrincipal and PrincipalCotext classes

I've seen many answers for that problem but none seem to fit to my. I'm strugguling very much with AD Authentication. The situation looks like this. We cave three domain controllers. We want to connecto the right one so that we don't get this…
0
votes
1 answer

get all Active Directory groups a user is member in

I am looking for a simple way to get all Active Directory Groups a given User is member in. There are two methods in UserPrincipal, but both don't match this requirement: GetGroups(): returns all groups, but not recursive: This method returns…
Breeze
  • 2,010
  • 2
  • 32
  • 43
0
votes
1 answer

Active Directory search (PrincipalSearcher) trailing wildcard ultra slow

I am searching within the domain active directory and it is very slow when using a trailing wildcard. Is there a good way of doing this efficiently? the wildcard at the end work almost instantly. Here the sample code: User = New UserPrincipal(ctx) …
Johnny Prescott
  • 263
  • 6
  • 23
0
votes
1 answer

How do I compare UserPrincipal with WindowsIdentity?

When binding a user to a Windows Account Im using the UserPrincipal SamAccountName according to this post(binding saved in database). Then when doing a login I need to check this binded user(from database) against the loggedin Windows Account and…
Banshee
  • 15,376
  • 38
  • 128
  • 219
0
votes
2 answers

Getting User Sid

I'm writing a service and I am trying to get the logged in User's sid and for whatever reason it is not working. It only returns {S-1-5-18}. Yet if I create a quick console application, it works just fine. I've tried 2 methods: WindowsIdentity usr…
GarudaLead
  • 469
  • 1
  • 5
  • 18
0
votes
0 answers

cannot change active directory shema

I'm working on the AD user management application. C#, UserPrincipal. So I need to add some extra attributes to AD shema, one of them is BirthDate. Our AD server is 2012 R2 Domain Controller. I'm following the manuals: Open mmc. Add "Active…
aligin
  • 1,370
  • 1
  • 13
  • 18
0
votes
2 answers

How to access the logged-in Principal from a session scoped spring bean

I want to access the logged-in user from a session-scoped spring bean, is that possible? I'm not using spring security, but openam instead to provide security to my web application, so I can't use this (as I've seen in many examples on the…
Henrique Ordine
  • 3,337
  • 4
  • 44
  • 70