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

  • SEARCH
  • Home
  • 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 6775227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:52:54+00:00 2026-05-26T15:52:54+00:00

In the Active Direcotry mmc snap-in you cant see attributes that are Not Set.

  • 0

In the Active Direcotry mmc snap-in you cant see attributes that are “Not Set”. When you use ADSIEDIT.MSC tool, if attribute values are null you do see them as “Not Set”.

How can I set an attribute to “Not Set” in .Net code?

Here is the answer in Powershell but I need to do it with some .Net code (VB.Net/C#).
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/d6d0bfa1-73da-41ea-a7f5-f622de9f7d1b/

ps msExchHideAddressLists is the culprit attribute, when its True or False in this domain it prevents user information replicating from AD to Sharepoint.

  • 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-05-26T15:52:55+00:00Added an answer on May 26, 2026 at 3:52 pm

    In the MSDN you can found :

    Within commonly used directories that support LDAP, an attribute without a value does not exist. When the attribute value is set to a non-null value by a change, replace, or append operation, the attribute is created if it does not already exist. Similarly, if an attribute is modified to have no value (or values), the entire attribute is removed. At times you may want to set an attribute to null. While this concept does not exist in directories that support LDAP, you can accomplish this by removing the attribute entirely and specifying that the property is to be cleared.

    Here is an example using System.DirectoryServices :

    /* Connection to Active Directory
     */
    DirectoryEntry deBase = new DirectoryEntry("LDAP://192.168.183.220:389/dc=societe,dc=local", "administrateur", "adm");
    
    /* Directory Search
     */
    DirectorySearcher dsLookForOUs = new DirectorySearcher(deBase);
    dsLookForOUs.Filter = "(objectCategory=organizationalUnit)";
    dsLookForOUs.SearchScope = SearchScope.Subtree;
    dsLookForOUs.PropertiesToLoad.Add("cn");
    dsLookForOUs.PropertiesToLoad.Add("ou");
    dsLookForOUs.PropertiesToLoad.Add("telephoneNumber");
    
    SearchResultCollection srcOUs = dsLookForOUs.FindAll();
    
    foreach (SearchResult srOU in srcOUs)
    {
      Console.WriteLine("{0}", srOU.Path);
      DirectoryEntry de = srOU.GetDirectoryEntry();
      if (de.Properties["TelephoneNumber"].Value!= null)
      {
        // Both solutions are working. Don't forget to commit
    
        //de.Properties["TelephoneNumber"].Clear();
        de.Properties["TelephoneNumber"].Value=null;
        de.CommitChanges();
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming that active directory is set up correctly, I'm trying to find a way
In Active Directory, there is a tab called Dial-In, and under that tab is
We currently have a View that queries active directory info. I was wondering if
I'm building an Active Directory wrapper in VBNET 2.0 (can't use later .NET) in
I need to access Active Directory to get information about groups that customers belong
Infrastructure has created an active directory account for me that has read access to
How to enable user account in Active Directory from Perl if that account is
Is there an equivalent tool available for use in Windows 7? I just need
sAMAccountName attribute is Active Directory unique username identifier, sometimes also present in the alias
I have created an Active Directory client using JNDI, that has the ability to

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.