You receive an "error 8007200D - The specified directory service attribute or value already exists" error message when you use the System.DirectoryServices namespace Add method to update multi-value attributes in Windows 2000 Server (894277)
The information in this article applies to:
- Microsoft .NET Framework 1.1 Service Pack 1 (SP1)
- Microsoft .NET Framework 1.0 SP3
SYMPTOMSWhen you use the System.DirectoryServices namespace Add method to set more than one property on a multi-value attribute, you receive the following error message: error 8007200D - The specified directory service attribute or value already exists.
This problem occurs after you install the Microsoft .NET Framework 1.0 Service Pack 3 (SP3) or the .NET Framework 1.1 SP1 and you try to create a new object in a Microsoft Windows 2000 Server domain. Note This problem does not occur in a Microsoft Windows Server 2003 domain. CAUSEIn the .NET Framework 1.0 SP3 and in the .NET Framework 1.1 SP1, the property cache behavior has changed to correct a security issue. Operations that were previously written to the property cache are now sent to the domain controller. In Windows Server 2003, Active Directory has been updated to process these operations correctly.WORKAROUNDTo work around this problem, use the Value method instead of the Add method. For example, the following Microsoft Visual C# code example uses the Add method. DirectoryEntry root = new DirectoryEntry("LDAP://<server>/dc=<domain>,dc=<DC>");
DirectoryEntry user = root.Children.Add("CN=<UserName>","user");
user.Properties[<strProperty>].Add("test1");
user.Properties[<strProperty>].Add("test2");
If you have code that is similar to this example, you should replace the Add methods with the following code: user.Properties[strProperty].Value = new string[]{"test1", "test2"};
Note There is an exception. If you are setting an attribute of type octet string or binary, you will not be able to use the Value method workaround. You will continue to use the Add method. STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Major | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbActiveDirectory kbnofix kbBug kbtshoot kbprb KB894277 kbAudITPRO kbAudDeveloper |
---|
|