Common Scripting Solutions
Common Scripting Solutions
In this reading, you will learn about a variety of scripting languages, their uses, and
their risks. As an IT Support professional, you may need to automate routine tasks.
For example, you might want to automate a backup of company data that runs
every night. You might also need to automate high volume tasks, like changing
security access settings on thousands of files. Scripting is a common tool used for
automation. This tool can help IT Support staff save time and resources in a busy
enterprise work environment.
Scripting languages
There are many scripting languages available to use for a variety of tasks in
different operating system environments. Most scripts are written in command line
environments.
PowerShell (.ps1) - Windows PowerShell is among the most common command line
scripting tools used in Windows environments. PowerShell is built on the .NET
platform and employs many of the same elements that programming languages do.
PowerShell scripts are used for building, testing, and deploying solutions, in
addition to automating system management.
Batch scripts (.bat) - Batch scripts, also called batch files, have been around since
the early days of MS DOS and OS/2. Batch files can execute simple tasks, like
calling a set of programs to run when a computer boots up. This type of script
could be useful in setting up employees’ workspaces when they power on their
computers.
Visual Basic Script (.vbs) - Visual Basic Script is an older scripting language. It has
reached its end of life for Microsoft support and has been replaced by PowerShell
scripts. However, as an IT professional, you may encounter .vbs scripts on some
legacy systems.
Scripting languages for Linux and Unix environments:
Shell script (.sh) - Shell scripting languages, like Bash, are used in Unix or Linux
environments. The scripts are often used to manipulate files, including changing
file security settings, creating, copying, editing, renaming and deleting files. They
can also be used to execute programs, print, navigate the operating system, and
much more. The scripts run in command-line interpreter (CLI) shells, such as the
Bourne shell, Bourne Again SHell (Bash), C shell, and Korn (KSH) shell.
Programming languages that can be used for scripting:
JavaScript (.js) - JavaScript the most used programming language in the world. It is
a lightweight language that is used for scripting in web development, mobile and
web apps, games, and more. It can also be used to develop software and
automate web server functions.
Python (.py) - Python is a user-friendly programming language that can perform
advanced tasks and import modules from libraries specially designed for
automation scripts.
Key takeaways
A basic knowledge of scripting is an important tool for IT professionals. You may
need to improve workflow efficiency by automating basic functions with a scripting
language. Some common scripting languages include:
Windows environments: batch scripts (.bat), Powershell (.ps1), Visual Basic Script
(.vbs)
Linux/Unix environments: shell scripts (.sh)
Most OS environments: javascript (.js), Python (.py)
Scripts have multiple helpful uses, such as:
Basic Automation
Restarting Machines
Remapping Network Drives
Installing Applications
Automating Backups
Gathering of information/ data
Initiating Updates
There are risks in using scripts, including: