Back in December I wrote about a remarkable free tool from Microsoft called Scriptomatic, which helps you write Visual Basic scripts to work with Windows Management Instrumentation (WMI). Since WMI is on the
Now "The Scripting Guys" at Microsoft (yes, that's how they bill themselves) have created ADSI Scriptomatic, a follow-up to the original Scriptomatic. But instead of writing scripts for WMI, this tool writes scripts for the Active Directory Search Interfaces (ADSI). Basically, it helps you create scripts to do common tasks with Active Directory, such as creating, reading, writing or deleting an object in AD, with the object types being a user, computer, contact, group or organizational unit.
The tool itself is fairly simple. Unpack it anywhere (it doesn't need to be installed to work), run it, and select both an action and an AD object type from the two drop-downs at the top of the form. When you do this, a sample script with comments will be generated in the body of the form, with each step of the code commented. Obviously, this code doesn't have to be used entirely as is: If you just want to scavenge the generated code for a single statement or two -- such as how to read and interpret the values for a single property in a given object -- that's fine (and is, in fact, its intended use).
Click on the Save button to write the results out to a finished script, or you can simply copy and paste from the open window into whatever code you're working on. Click Run, and the code currently in the code window (which can be edited in place, by the way) will be executed from a command-line script session.
Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!
More information from SearchWinSystems.com
- Tip: Free Microsoft
utility helps write WMI scripts
- Topics: Scripting
- RSS: Sign up for our RSS feed to receive expert advice every day.
This was first published in February 2006