Questions tagged [account-management]

116 questions
1
vote
1 answer

AccountManagement is Principal GroupPrincipal?

How do I take a principal and see if it is a group? or that it has members? using(var ctx = new PrincipalContext(ContextType.Domain, "some.domain.com", "DC=some,DC=domain,DC=com")) { var group = GroupPrincipal.FindByIdentity(ctx,…
Chris Hayes
  • 3,876
  • 7
  • 42
  • 72
1
vote
1 answer

Network Path not found error when adding a network group to local administrators group

I am trying to add a network group on our domain to the local administrators group on the machine. I debug line by line and it finds the local administrator group, it finds the network group but when it gets to this…
JoshF
  • 159
  • 4
  • 15
1
vote
1 answer

Email management for adding new email and setting an email as primary email

Meteor has tons of account management packages which all do likely the same thing as accounts-ui. For an application im working on I need a user to be able to add a new e-mailadress and set it as primary after the email is verified. For met this…
1
vote
0 answers

Constructing Extended User Principal without explicit Principal Context of domain

Recently I've been implementing custom ExtendedUserPrincipal class similar to sample here. The only problem for me is to construct new instance based on existing instance of base class (e.g. UserPrincipal.Current), to map existing user principal to…
Aloraman
  • 1,389
  • 1
  • 21
  • 32
1
vote
2 answers

Constraint Violation When Creating AD User Object with account management extension class attributes

I'm creating a WCF service to retrieve and update/create AD Person objects, and have run into a snag. I created an extension class to manage extended attributes (delivered schema attributes, but not in the default account management class attribute…
Jeff
  • 65
  • 2
  • 2
  • 9
1
vote
1 answer

Add multiple users to an AD group *quickly* using AccountManagement

I have a very large number of users that I need to add to an AD group. I have all the users SAMAccountNames stored in a datagridview. The code below works but slowly. It's as if it's querying each user directly when I call g.members.add. Is there a…
Force
  • 3,288
  • 1
  • 13
  • 19
1
vote
1 answer

Enabling Users to Edit Custom Account Settings in MVC

From the bare-bones MVC project template, I've extended ApplicationUser.cs to display a new user account setting called DisplayName (its a display name that people will use in a chat application as part of the site): public string DisplayName { get;…
Alexandru
  • 12,264
  • 17
  • 113
  • 208
1
vote
1 answer

GetGroups method in system.DirectoryServices.AccountManagement does seem to refresh

Essentially what I'm trying to do is add a computer/user to a group. After I add the object to the group, I want to query the groups of the object to see what they have. It seems that the GetGroups method doesn't update fast enough. My test…
Lareau
  • 1,982
  • 1
  • 26
  • 47
1
vote
2 answers

Can not set AD-LDS user-password with the UserPrincipal-class

I’m stuck with the UserPrincipal class manipulating AD-LDS user-objects. While I can query users, change attributes and save them back to AD LDS, as soon as I try to set (or change) the password, I always get a PrincipalOperationException with the…
HCL
  • 36,053
  • 27
  • 163
  • 213
1
vote
0 answers

PrincipalContext.ValidateCredentials always returns false for an account with mixed-case user name

I got two domain user accounts. One has a lower-case user name and another one has mixed-case user name, like "JohnSmith". ValidateCredentials works fine for the lower-case user name. However, for the mixed-case user name it always returns…
Ivan Gerken
  • 914
  • 1
  • 9
  • 21
1
vote
1 answer

Getting EmailAddress NULL from Active Directory (AccountManagement UserPrincipal)

I have a problem and can not find solution: I have the code below to retrieve the e-mail (EmailAddress) user that is accessing the web application. var pc = new…
1
vote
1 answer

Exception regarding context options for creating new user with System.DirectoryServices.AccountManagement

I need to create new users in AD with a randomly generated password that must be reset on first login. I can connect without issue using DirectoryEntry but I would like to use System.DirectoryServices.AccountManagement. When attempting to connect to…
1
vote
3 answers

Cannot implicitly convert type System.DirectoryServices.AccountManagement.Principal to string

I've got a variable which is a list of strings var names = new List(); I want to assign the names of the results of a .AccountManagement.Principal query to names PrincipalContext ctx = new PrincipalContext(ContextType.Domain); UserPrincipal buser…
Sam Stephenson
  • 5,200
  • 5
  • 27
  • 44
1
vote
0 answers

Combining DirectoryServices.AccountManagement & Role Provider

Is it possible to use a custom role provider, or Windows/SQL for that matter, with System.DirectoryServices.AccountManagement? I validate the users this way and it would be nice if I could use a role provider to manage website content. Is this even…
0
votes
1 answer

C# ActiveDirectory keeps returning false. Why?

I know my Account Username and password. I am able to login to any PC on the domain. Console.WriteLine("User Name: " + userName + " Password: " + tb.Text.ToString().Trim()); System.DirectoryServices.AccountManagement.PrincipalContext pc = new…
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177