Subscribe to Windows IT Pro
November 01, 1997 12:00 AM

Use ADSI with WSH

Windows IT Pro
InstantDoc ID #554
Rating: (0)

Administrators can use ADSI with WSH. NT 5.0 will include WSH; for NT 4.0, you need to download it from http://www.microsoft.com/ management/WSH. htm. You can create scripts with any text processor (such as Notepad) and run the scripts in a command window with the command

cscript myscript.vbs

You can replace cscript with wscript so that you can use a graphical interface. However, wscript shows each line of output in a separate message box. If you list 200 users, you will get 200 message boxes.

The code in this article is written in VB, but it also works with WSH, with the exception of the code to determine the optional properties. To write the examples in WSH, follow these steps:

1. Remove all Dim statements.
2. Replace each Debug.Print with WScript.Echo.
3. Put a comma instead of the tab character (Chr$(9)).
4. Remove the variable names on the Next lines.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.