4.8 - CompTIA A+ Core 2

  • PROJECT IDEA: Make a GitHub repo that stores different scripts and how they are used + classifications as to what they do (general purpose, information gathering). Organize them all into a text expander.

Script file types

.bat

  • .bat: Batch files - provide scripts for the Windows command line (cmd.exe). The legacy goes back to MS-DOS and OS/2.

.ps1

  • .ps1: PowerShell files - files for Windows PowerShell, used by system administrators to extend command-line functions with cmdlets (command-lets). Operate as standalone executables.

.vbs

  • .vbs: VBScript files - used for general-purpose scripting/automation. Also used for back-end web server scripting, the Windows server front-end, and MS Office.

.sh

  • .sh: Linux/Unix shell files - automate and extend Linux terminal functionalities. Files start with a shebang/hash-bang (#!).

.js

  • .js: JavaScript files - JS scripts are used to add dynamic content to static webpages.

.py

  • .py: Python files - used for general-purpose scripting and widely utilized in web development, data analysis, artificial intelligence, and automation tasks.

Use cases for scripting

Basic automation

  • Basic automation: Use case for scripting that allows you to automate common, mundane tasks.

Restarting machines

  • Restarting machines: Scripting use case that allows you to turn machines off and on again (also allows installations of security patches or applications that require a restart).

Remapping network drives

  • Remapping network drives: Scripting use case used to automatically link drive partitions to a networked folder. Also used to automate software changes or add/move user data to a different share.

Installation of applications

  • Installation of applications: Scripting use case that allows you to automatically install applications to a machine.

Automated backups

  • Automated backups: Scripting use case that allows scheduling/executing regular backups to be performed during off-hours.

Gathering of information/data

  • Gathering of information/data: Scripting use case that enables the extraction and organization of system information, performance monitoring, or user data for analysis and reporting.

Initiating updates

  • Initiating updates: Scripting use case that automates the installation of updates, including new OS versions, new device drivers, and new security patches.

Other considerations when using scripts

Unintentionally introducing malware

  • Unintentionally introducing malware: Scripting risk that can occur if scripts are sourced from unreliable or untrusted origins, leading to potential security vulnerabilities. Make sure you know what you’re installing.

Inadvertently changing system settings

  • Inadvertent settings changes: Scripting risk that occurs when a deployed script modifies an unintended configuration option. Mitigate by testing all scripts before official deployment.

Browser or system crashes due to mishandling of resources

  • Browser/system crashes: Scripting risk that occurs when a deployed script causes an OS/browser to suddenly stop working. Mitigate by having OS backups and testing before deployment.