Main page image

Windows Admin Scripting

Repetitive admin tasks seem to be unavoidable these days in a Windows environment. Most administrators can point and click their way through these tasks, but the really good ones will identify where the process should be automated by scripting.

Whenever possible Exmos has adopted a scripting solution to these admin tasks allowing for quicker and more effective support.

Several scripting languages have been adopted and utilised over the years, from batch files using windows CMD shell to VB scripts and now the very effective and powerful Windows PowerShell.

CMD

The windows CMD shell is the staple of all good network administrator scripts. Simple batch files can be created to allow simple admin tasks to be scheduled or run on demand as required.

Some examples of batch files Exmos use:

  • Automatically build folder structures with consistent folder layout and security attributes.
  • Novell Netware to NT migration of user accounts and groups. Batch files used to create the target records allowed for repeated testing before automated migration.
  • Data backup. Almost every server in every site will have scheduled tasks setup to move, copy, (or robocopy!) data to backup locations (in addition to their main backup routine).

VBScript

VBscript allows network administrators to begin to work at higher technical level. Although thought of as an older technology, VBscript will be around for a while yet

Some examples of VBScript Exmos use:

  • Collecting SMTP queues from MS exchange servers and emailing the results to network administrators. Simple Exchange monitoring and if the queues build up we get notified.
  • SQL to HTML emails. Simple scripts which send summary e-mail messages to people on a scheduled basis.
  • Summary reports of Windows Event Log contents.

PowerShell

PowerShell was introduced by Microsoft in 2006 after years of lacking a decent, powerful shell. Closely integrated with the Dotnet framework, it is now finding its way into other Microsoft products to provide command line administration (e.g. Exchange Server, SQL Server).

Some examples of PowerShell Exmos use:

  • Invoice distribution by e-mail.
  • Active Directory Summary of user account details.
  • Check for Locked user accounts and send notification e-mail to administrators
  • Document/folder organisation. Users dump files into an open directory. PowerShell checks name and type and moves them to other published locations as required.