The SearchAD function finds the ADsPaths to objects in the huge Active Directory (AD) hierarchy of Windows 2000 (Win2K). With Windows NT, you don't need to worry about finding the ADsPaths because every object is in one container. Consequently, if you want to use IDPrintQueue.vbs or BindPrintQueue.vbs, you need to replace the SearchAD function with other code.

You can use the IADsContainer::Filter and IADsContainer::Count methods that I introduced in "An ADSI Primer, Part 7: Manipulating Persistent and Dynamic Objects" (July 1999) in place of the SearchAD function. If you bind to the WinNT: provider on your NT machine and set the filter to display only printer objects, you can use a For Each...Next statement to iterate through the container and print the IADs::ADsPath, IADs::Name, and other required printer attributes.