•Arnošt Havelka
Practical: System Audit
Scripting a professional system inventory report.
Start Interactive LessonPractical: System Audit Script
As a Sysadmin, your boss wants a report on a workstation's status. Instead of running commandsmanually, let's write a batch script to generate a professional report automatically.
The Mission
Create audit.bat that:
- Grabs the Hostname.
- Grabs the IP Address.
- Grabs the Running Processes.
- Saves it all to
report.txt.
Step 1: The Script Structure
We will use echo to create headers and redirection >> to compile the file.
Command Prompt
C:\Users\User>copy con audit.bat
Step 2: Running the Audit
Execute the script.
Command Prompt
C:\Users\User>audit.bat
Step 3: Viewing the Report
Let's see what we generated.
Command Prompt
C:\Users\User>type report.txt
Knowledge Check
1 / 2Why do we use '>>' instead of '>' for the second command?