Microsoft KB Archive/899114

From BetaArchive Wiki
Knowledge Base


The DirectorySearcher class throws an exception when you use the FindOne() function or the FindAll( ) function to call an object that has the sIDHistory attribute

Article ID: 899114

Article Last Modified on 11/16/2007



APPLIES TO

  • Microsoft .NET Framework 1.0






SYMPTOMS

When the FindOne() function or the FindAll( ) function of the DirectorySearcher class calls an object that has the sidHistory attribute, the DirectorySearcher class throws the following exception:

An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: Byte array for GUID must be exactly 16 bytes long.

WORKAROUND

To work around this problem, set the following properties before you use the FindOne() function or the FindAll() function:

dsr.PropertyNamesOnly = True
dsr.PropertiesToLoad.Add("samAccountName")

Note In this code, dsr is an instance of the DirectorySearcher class.

STATUS

This problem was corrected in the Microsoft .NET Framework 1.1.

REFERENCES

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

818031 FIX: Adding group memberships by using the System.DirectoryServices namespace can truncate group members


For more information about the sIDHistory attribute, visit the following Microsoft Web site:

Keywords: kberrmsg kbtshoot kbactivedirectory kbprb kbcode KB899114