Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


August 13, 2002

Query Workstations the Easy Way


RSS
View this exclusive article with VIP access -- click here to join |
See More Task Automation Articles Here | Reprints | Or sign up for our VIP Monthly Pass!
How to quickly obtain data from multiple workstations

Your company is purchasing a new application, so you need to make sure that 500 workstations have a certain service pack level installed on them—a common task that script-savvy network administrators can easily perform. Typically, .bat and .cmd scripts that perform a task against a list of workstations consist of one line that performs the task and supportive code that connects to the workstation and returns error codes. Wouldn't it be nice if you didn't have to write the supportive code over and over again? A good practice is to reuse code that has already been tested and proven, but keeping track of numerous code snippets can be a challenge.

If you find yourself in this situation, try keeping just one master script that you can add operations to as needed. Letting one script grow in this fashion keeps your code centralized and within easy reach. Plus, it's truly reusable code—not copies of code in multiple scripts that can become outdated. Ideally, master scripts

  • work off a list of workstations
  • test each workstation to see whether it's a valid machine and powered on
  • connect to each workstation
  • perform whatever task you need
  • log results and error codes

In .bat or .cmd scripts, you typically want code that you can implement easily and quickly. Thus, the master script must start out and remain easily modifiable. I created an easily modifiable script called Chkws, which I've tested on Windows NT 4.0 Service Pack 6 (SP6) through Windows 2000 SP2. Let's look at how Chkws works and how to add operations to it. . . .


Already a VIP member?
Please log on to view the full article

Why become a VIP member?

VIP-only online access
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine

Subscribe Now
Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...


Task Automation Whitepapers From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

Related Events Check out our list of Free Email Newsletters!

Task Automation eBooks Spam Fighting and Email Security for the 21st Century

A Guide to Windows Certification and Public Keys

Keeping Your Business Safe from Attack: Patch Management

Related Task Automation Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement