======================================================================== STRATEGIC DEVELOPER: JON UDELL http://www.infoworld.com ======================================================================== Thursday, November 4, 2004
WINDOWS ADMIN MADE EASY By Jon Udell Posted October 29, 2004 3:00 PM Pacific Time System administration has always been windows' Achilles' heel. The graphical tools that simplify basic chores just get in the way when there's heavy lifting to be done. And CMD.EXE, the hapless command shell, pales in comparison to the Unix shells that inspired it. Win32 Perl has been my ace in the hole, combining a powerful scripting language with extensions that can wield Windows' directory, registry, event log, and COM services. But I've always thought there should be a better way. ADVERTISEMENT -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- GRID COMPUTING: AN INTRODUCTION DEMONSTRATION The Grid unites servers and storage into a single system that acts as a single computer - all your applications tap into all your computing power. Hardware resources are fully utilized and spikes in demand are met with ease. This demonstration sponsored by Oracle brings you the resources you need to evaluate your organization's adoption of grid technologies. The Grid is ready when you are. http://newsletter.infoworld.com/t?ctl=9BE6B9:2B910B2 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Jeffrey Snover thought so, too. He's the architect of Monad, aka MSH (Microsoft Shell), the radical new Windows command shell first shown at the Professional Developers Conference last fall. A meeting with Snover piqued my interest, as did his video demonstration on MSDN's Channel 9. This week, I finally got a chance to give this new tool a try. You don't need Longhorn, by the way. I'm running MSH on Windows XP with the 2.0 version of the .Net Framework that comes with the Visual Studio 2005 beta. My first reaction? MSH rocks. System administration on Windows, and ultimately everywhere, will be forever changed for the better. At its core, MSH is an object pipeline. Unix, of course, invented the pipelining concept. But in Unix-like systems -- including Linux and OS X -- the data that's passed from one command to the next is weakly structured ASCII text. When you've got smart, self-describing objects flowing through that pipeline, it's a whole new ball game. Recently, for example, I wrote a typical management script for a Windows 2003 Server. Its job was to filter a subset of running processes by name and then kill any of those exceeding a memory threshold. Using Python in conjunction with Mark Russinovich's PsTools suite, I did this in the time-honored way: List the processes, split the output into columns, associate the first and third columns with process name and memory use, and then finally identify and kill memory hogs. Here's the drill with MSH. You start by typing the command get-process. As does Unix's ps command, get-process prints a bunch of process statistics on the console. But under the covers, it emits a sequence of System.Diagnostics.Process objects. You can look up that class in the .Net Framework documentation, but it's easier to just ask an instance of the object to display its methods and properties. If there are too many to view conveniently on the console, pipe the information to an HTML file, a .Net grid control, or an Excel worksheet. When you've identified the properties of interest, it's trivial to isolate them, filter them, and pipe the filtered subset to the stop-process command. With a pipeline full of .Net objects, it's all oddly familiar yet dramatically easier. MSH is quirky, complex, delightful, and utterly addictive. You can, for example, convert objects to and from XML so that programs that don't natively speak .Net can have a crack at them. There's SQL-like sorting and grouping. You write ad hoc extensions in a built-in scripting language that feels vaguely Perlish. For more permanent extensions, called cmdlets, you use .Net languages. With MSH, Windows system administration manages to be both fun and productive. And the story will only improve as the .Net Framework continues to enfold Windows' management APIs. Competitors take note: Windows is about to convert one of its great weaknesses into a strength. Jon Udell is lead analyst at the InfoWorld Test Center. ======================================================================== Because no network is an island, including yours. Your business depends on your network and the networks you network with. InfoWorld's "Networking Report" newsletter summarizes key developments that might affect your networking plans and performance (and lets you click through for more). Keep current with what you need to know about your network and the greater world of networking that you're part of. Subscribe at http://newsletter.infoworld.com/t?ctl=9BE6B5:2B910B2 ADVERTISE ======================================================================== For information on advertising, contact [EMAIL PROTECTED] UNSUBSCRIBE/MANAGE NEWSLETTERS ======================================================================== To subscribe, unsubscribe or change your e-mail address for any of InfoWorld's e-mail newsletters, go to: http://newsletter.infoworld.com/t?ctl=9BE6B6:2B910B2 To subscribe to InfoWorld.com, or InfoWorld Print, or both, or to renew or correct a problem with any InfoWorld subscription, go to http://newsletter.infoworld.com/t?ctl=9BE6B8:2B910B2 To view InfoWorld's privacy policy, visit: http://newsletter.infoworld.com/t?ctl=9BE6B7:2B910B2 Copyright (C) 2004 InfoWorld Media Group, 501 Second St., San Francisco, CA 94107 This message was sent to: [EMAIL PROTECTED]
