Boolean Property Type
The Active Directory Domain Services Schema Boolean syntax type is used for properties such as the isDefunct attribute and the isDeleted attribute. System.DirectoryServices treats this syntax type as a Boolean value. In ADSI, this property type is identified as ADSTYPE_BOOLEAN. For more information about ADSTYPE_BOOLEAN, see the ADSTYPEENUM enumeration documentation in the MSDN Library at https://go.microsoft.com/fwlink/?LinkID=27252. For more information about the Boolean syntax, the isDefunct attribute or the isDeleted attribute, see "Boolean syntax", "Is-Defunct attribute" or "Is-Deleted attribute" in the MSDN Library at https://go.microsoft.com/fwlink/?LinkID=27252
The following example shows how to read a property with a Boolean value.
Console.WriteLine(usr.Properties("isDeleted").Value)
Console.WriteLine(usr.Properties["isDeleted"].Value);
The following code example shows how to set a single-valued Boolean property to true.
usr.Properties("isDeleted").Value = True
usr.CommitChanges()
usr.Properties["isDeleted"].Value = true;
usr.CommitChanges();
The following example shows how to add a value of true to a multi-valued Boolean property.
usr.Properties("isDeleted").Add(True)
usr.CommitChanges()
usr.Properties["isDeleted"].Add(true);
usr.CommitChanges();
See Also
Reference
System.DirectoryServices
Boolean
Concepts
Send comments about this topic to Microsoft.
Copyright © 2007 by Microsoft Corporation. All rights reserved.