AD search error work-around? 
Author Message
 AD search error work-around?

Does anyone know how to work around this problem?
using this function on a live Active directory returns the error -
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll

Additional information: Byte array for GUID must be exactly 16 bytes long.
mySearcher.FindAll()

This only happens on user accounts that were migrated from one domain to
another using ADMT from ms.

Is there a way to work around this?

Here is the complete code,

I have this same code in C# and get the same error.

Sub Main()

Dim entry As New DirectoryServices.DirectoryEntry("LDAP://my.company.com")

Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)

Dim res As DirectoryServices.SearchResult

Dim userName As String = "(anr="

Dim theName As String

Console.WriteLine("Enter User to view")

theName = Console.ReadLine()

userName = userName + theName + ")"

mySearcher.SizeLimit = 10

mySearcher.Filter = userName

For Each res In mySearcher.FindAll()

Console.WriteLine(res.GetDirectoryEntry.Path)

Next



Sat, 11 Dec 2004 22:11:58 GMT  
 AD search error work-around?
If you debug the program, please check if Byte array for GUID is exactly 16
bytes long.

You may pay additional attention to those 'invisible' characters, such as
trailing blank spaces.

--
Peter Wu
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Quote:

>Subject: AD search error work-around?
>Date: Tue, 25 Jun 2002 08:11:58 -0600
>Lines: 47
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.3604.0
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3604.0

>Newsgroups: microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: 64.215.88.90
>Path: cpmsftngxa08!tkmsftngp01!tkmsftngp09
>Xref: cpmsftngxa08 microsoft.public.dotnet.languages.vb:51392
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>Does anyone know how to work around this problem?
>using this function on a live Active directory returns the error -
>An unhandled exception of type 'System.ArgumentException' occurred in
>mscorlib.dll

>Additional information: Byte array for GUID must be exactly 16 bytes long.
>mySearcher.FindAll()

>This only happens on user accounts that were migrated from one domain to
>another using ADMT from ms.

>Is there a way to work around this?

>Here is the complete code,

>I have this same code in C# and get the same error.

>Sub Main()

>Dim entry As New DirectoryServices.DirectoryEntry("LDAP://my.company.com")

>Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)

>Dim res As DirectoryServices.SearchResult

>Dim userName As String = "(anr="

>Dim theName As String

>Console.WriteLine("Enter User to view")

>theName = Console.ReadLine()

>userName = userName + theName + ")"

>mySearcher.SizeLimit = 10

>mySearcher.Filter = userName

>For Each res In mySearcher.FindAll()

>Console.WriteLine(res.GetDirectoryEntry.Path)

>Next



Sun, 12 Dec 2004 13:25:06 GMT  
 AD search error work-around?
When I debug the function mySearcher() throws an exception on the call and
does not return the values.



Quote:
> If you debug the program, please check if Byte array for GUID is exactly
16
> bytes long.

> You may pay additional attention to those 'invisible' characters, such as
> trailing blank spaces.

> --
> Peter Wu
> Microsoft Corporation

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> --------------------

> >Subject: AD search error work-around?
> >Date: Tue, 25 Jun 2002 08:11:58 -0600
> >Lines: 47
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.3604.0
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3604.0

> >Newsgroups: microsoft.public.dotnet.languages.vb
> >NNTP-Posting-Host: 64.215.88.90
> >Path: cpmsftngxa08!tkmsftngp01!tkmsftngp09
> >Xref: cpmsftngxa08 microsoft.public.dotnet.languages.vb:51392
> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb

> >Does anyone know how to work around this problem?
> >using this function on a live Active directory returns the error -
> >An unhandled exception of type 'System.ArgumentException' occurred in
> >mscorlib.dll

> >Additional information: Byte array for GUID must be exactly 16 bytes
long.
> >mySearcher.FindAll()

> >This only happens on user accounts that were migrated from one domain to
> >another using ADMT from ms.

> >Is there a way to work around this?

> >Here is the complete code,

> >I have this same code in C# and get the same error.

> >Sub Main()

> >Dim entry As New

DirectoryServices.DirectoryEntry("LDAP://my.company.com")

- Show quoted text -

Quote:

> >Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)

> >Dim res As DirectoryServices.SearchResult

> >Dim userName As String = "(anr="

> >Dim theName As String

> >Console.WriteLine("Enter User to view")

> >theName = Console.ReadLine()

> >userName = userName + theName + ")"

> >mySearcher.SizeLimit = 10

> >mySearcher.Filter = userName

> >For Each res In mySearcher.FindAll()

> >Console.WriteLine(res.GetDirectoryEntry.Path)

> >Next



Sun, 12 Dec 2004 23:46:35 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. AD Search error

2. Work Around doesn't work for RichTextBox

3. Ad hoc reps,Searching text,wizards

4. Ad Hoc Reports, Searching Text, Wizards

5. NooB:How can i call the SEARCH PRINTER WINDOW in AD via VBscript

6. Script for Filtering search results from AD

7. AD Searching limitied to first 1000 records

8. Search Users AD Problem

9. HELP: functions inp/out/peek/poke for working with AD/DA board in VB4

10. Need VB library to work with AD and DA convertors

11. working with clients for AD attributes

12. Work Around for Update?

 

 
Powered by phpBB® Forum Software