TECHNOLOGY
Windows Automation (Scripting)

What to do if program product that you have selected solves only 90 per cent of your tasks and does not have only one key feature? How to integrate 1C database with existing company’s site that is even quick-and-dirty but nevertheless completely satisfies you? Why does system administrator expend a half of his work hours in routine maintenance of existing systems instead of earning profit for the company by improving work processes? Why do developers request a month for developing feature which will be used during only one week?

The answers to all these and many other questions appearing in the work of IT-specialists are often scenarios (or scripts). There is wide-spread opinion that tasks automation, scripts and command prompt are in a bad way in Windows environment. But though Unix-based systems indeed have a long-term head-start in this regard, recently Windows keeps up the pace with them. To a large extent this fact results from Windows PowerShell appearance.

Windows PowerShell

http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/5315.powershell_2D00_logo.gifWindows PowerShell is Microsoft’s extensible automation tool consisting of command-line shell and associated scripting language. PowerShell was demonstrated for the first time in 2003 and since then has been rapidly developed and is getting more and more popular. Windows PowerShell is available for Windows XP/2003 or higher and since Windows 7/2008 it is a built-in component of operating system. PowerShell is still being improved, new versions contain more and more features while being compatible with scripts and modules created for previous versions.

 

Windows PowerShell is built on Microsoft .Net Framework and is integrated with it. Also PowerShell provides access to COM, WMI and ADSI interfaces as well as allows executing general command-line commands for creating unified environment where administrators can perform different tasks on both local and remote systems and automate them.

Also PowerShell provides embedding technology due to which its runtimes can be embedded into other applications. These applications can then use PowerShell functionality to perform various operations including those exposed via graphical interface. This approach has been used in Microsoft Exchange Server 2007 to provide its management functionality by the means of PowerShell cmdlets and to implement graphical management tools as PowerShell shells which invoke required cmdlets. Thus graphical management interface is layered over PowerShell being intermediate level. Other Microsoft applications including Microsoft SQL Server 2008, System Center Operations Manager and System Center Data Protection Manager also give access to their management interfaces via PowerShell cmdlets.

Windows PowerShell ISE

Among built-in PowerShell features the following ones are worth mentioning:

  • Comprehensive updatable integrated help system.
  • Easy and handy finding required commands.
  • Integrated graphical development environment with IntelliSense support.
  • System of completion of commands, parameters and almost all the rest which can be typed in the command-line.
  • Interactive debugger having capability to connect to remote system.
  • Automated downloading of available modules if necessary.
  • PowerShell Remoting is a mechanism for connecting, commands execution and interactive work on the remote servers using secure protocols and authentication ways.
  • Background works including those on remote servers and integration with task scheduler.
  • Windows PowerShell WebServices is a mechanism for easy creating web-services meeting standards on the basis of PowerShell commands and scripts.
  • Windows PowerShell Workflow is a capability to create processes using XAML or PowerShell.
  • Windows PowerShell Web Access is a mechanism of remote access to PowerShell console via web-browser.
  • Support in Windows PE (Preinstallation Environment) that expands capabilities of PowerShell using in deployment or maintenance of operating systems.
  • Automated real-time scripts compilation for performance increase.

http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-60-64-metablogapi/7026.pswa_2D00_safari_5F00_6878EEA5.png

List of products and technologies supporting PowerShell and integrated with it is continuously expanding. You can find relatively up-to-date lists at the following pages:

If there is no required product or solution in these lists it only means that for integration with it PowerShell’s capabilities for work with Microsoft .NET, WMI, COM, etc. should be used.

Finally, working with PowerShell is convenient and pleasant that in its turn affects both time of its studying and rate and quality of scripts development in it.

VBScript, CMD

Although PowerShell is a perfect tool, unfortunately using it is not always available and reasonable. Thus, due to its relatively small age it is not available in operating systems lower than Windows XP. Moreover, often support or improvement of old, proven and working for a long time scenarios is required. In such cases Visual Basic Script and Windows Batch (CMD) can help.

Visual Basic Script is not being developed any more, scripts development using it takes a lot of time and it does not have a lot of useful features, but nevertheless it provides functionality sufficient for solving various tasks.

Windows Batch is rather handy for cases when automation tasks are simple enough and do not require complicated logic, e.g. invocation of several command-line utilities.

Additional information

If you have any questions about automation technologies, their capabilities or in case you want to order an especial training course for employees of your company, you can contact us by this application form.