Script Tips
ADSI Resources
Better ADSI documentation is coming. For now, Microsoft's version will have to do.
A reader writes, "Where can I find a resource that lists the classes available
from the WinNT ADSI provider?"
I do wish ADSI were better documented from a scripting point of view. In fact,
author Cade Fasset is working on ADSI Scripting: TFM (yes, the "TFM"
from "RTFM"!) which should be coming out soon. In the meantime, Microsoft
does have documentation available. Unfortunately, it's meant more for C++ programmers,
so you'll have to kind of squint your eyes for it to make sense, but it'll at
least tell you what types of objects you have to work with. The online docs
can be found here.
Here's how to use them: Let's say you're interested in the FileService class.
Click on IADsFileService to see what it can do. This will list all its properties
and methods.
Want to work with open resources? A note says, "To access active sessions
or open resources used by the file service, you must go through the IADsFileServiceOperations
interface to retrieve sessions or resources." OK, go back one page and
click on IADsFileServiceOperations; you'll see the properties and methods the
file server operations can have, including the Resources collection. Click on
that and you learn that it's a collection of IADsResource interfaces.
Sigh.
Click on IADsResources and you'll finally see that open resources have a
name, lock count, path, user, user path and other properties. Hurry up with
that book, Cade.
About the Author
With more than fifteen years of IT experience, Don Jones is one of the world’s leading experts on the Microsoft business technology platform. He’s the author of more than 35 books, including Windows PowerShell: TFM, Windows Administrator’s Scripting Toolkit, VBScript WMI and ADSI Unleashed, PHP-Nuke Garage, Special Edition Using Commerce Server 2002, Definitive Guide to SQL Server Performance Optimization, and many more. Don is a top-rated and in-demand speaker and serves on the advisory board for TechMentor. He is an accomplished IT journalist with features and monthly columns in Microsoft TechNet Magazine, Redmond Magazine, and on Web sites such as TechTarget and MCPMag.com. Don is also a multiple-year recipient of Microsoft’s prestigious Most Valuable Professional (MVP) Award, and is the Editor-in-Chief for Realtime Publishers.