Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:24:27+00:00 2026-06-10T14:24:27+00:00

I am trying to add a property/attribute to a user entry in Active Directory.

  • 0

I am trying to add a property/attribute to a user entry in Active Directory. I don’t have any trouble updating property values using the following code.

string LDAPString = "LDAP://DC=oc,DC=edu";
DirectoryEntry ou = new DirectoryEntry(LDAPString, "fakeUsername", "password");

DirectorySearcher searcher = new DirectorySearcher(ou);
searcher.Filter = "sAMAccountName=" + username;
SearchResult result = searcher.FindOne();

DirectoryEntry user = new DirectoryEntry(result.Path, "fakeUsername", "password");

user.Properties[propertyName].Value = propertyValue;

user.CommitChanges();

user.Dispose();

However when I try to add a new item and call CommitChanges() it throws an error:

The specified directory service attribute or value does not exist.

The ExtendedErrorMessage says the following:

00000057: LdapErr: DSID-0C090B8A, comment: Error in attribute
conversion operation, data 0, v1db1

string propertyName = "test";
string propertyValue = "testValue";
user.Properties[propertyName].Add(propertyValue);
user.CommitChanges();

I have a feeling I am missing something simple but I can’t seem to figure it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:24:28+00:00Added an answer on June 10, 2026 at 2:24 pm

    I did not understand that typically a property/attribute does not appear unless it is populated with a value. As marc_s alluded to the property is already there in the schema you just have to populate it with a value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add a dependency to a class property using Unity Configuration
I am trying to add a RegularExpression attribute to a property in a ViewModel
I'm trying to add entity to SQL CE 4 which have property of type
I'm using VB 2008 and I'm trying to add a xmlns=mynamespace attribute to an
Using the System.DirectoryServices.Protocols namespace to add/modify attributes on an Active Directory group. Code: public
I am trying to add a custom property to a base form that can
I'm trying to add a IsImage property that I wrote myself to the HttpPostedFile
I am currently trying to add a custom column name to a property in
I'm trying to create some 'friend assemblies' using the [InternalsVisibleTo()] attribute, but I can't
I'm trying to figure out MEF's Constructor Injection attribute. I have no idea how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.