Lab 1.14 – Using System Commands (Windows PowerShell)

Lab Context & Environment

  • Scenario Overview
    • You are working in Lab 1.14 – Use System Commands.
    • Goal: Practice fundamental Windows 11/PowerShell (Windows Terminal) commands to explore the file system and manage resources.
    • All tasks are executed inside a pre-configured lab VM.
  • General Workflow
    • Open Windows Terminal ➜ execute commands in sequence ➜ answer embedded quiz questions ➜ verify results ➜ score the lab.

Task 1 – Copy a File to a New Folder

  • Objective: Copy cat.jpg from D:\graphics to a newly created E:\graphics folder.
  • Step-by-Step Commands
    • E: ➜ switch to E drive.
    • md graphics (alias mkdir) ➜ create folder graphics on E:.
    • D: ➜ switch to D drive.
    • cd graphics ➜ enter source folder.
    • copy cat.jpg E:\graphics ➜ perform file copy.
    • E: ➜ return to E drive.
    • dir ➜ confirm cat.jpg now exists in E:\graphics.
  • Key Concepts
    • md / mkdir creates directories.
    • copy moves files between paths; destination can include a drive-letter root.
  • Practical Relevance
    • Mirrors day-to-day administrator activity: staging assets, validating migrations.

Task 2 – DNS Query with nslookup

  • Objective: Retrieve the IP of corpserver.corpnet.local.
  • Command: nslookup corpserver.corpnet.local
  • Output Highlights
    • Responds with two A-records; choose the entry labelled corpserver.
    • Reported address: 192.168.0.10.
  • Concept Refresher
    • nslookup queries DNS servers interactively/non-interactively.
    • Useful for diagnosing name-resolution, validating zone records, and confirming AD DS registrations.

Task 3 – File-System Consistency Check (chkdsk)

  • Objective: Scan the *D:* data volume.
  • Command Sequence
    • chkdsk D: ➜ initiates a read-only scan (default).
  • Critical Output Field
    • Bad Sectors = 0.
  • Why It Matters
    • Detects physical disk errors, allocation bitmap corruption, or orphaned clusters.
    • Bad sectors > 0 often trigger SMART monitoring & potential disk replacement.

Task 4 – Force Group-Policy Refresh (gpupdate)

  • Objective: Apply latest domain policies to the workstation immediately.
  • Command: gpupdate
  • Result: Computer Policy and User Policy both complete with status “Successfully processed”.
  • Note: By default, GP refreshes every 90 minutes + randomized 0–30. Manual invocation reduces wait time when testing new GPOs.

Task 5 – Enumerate Applied GPOs (gpresult /R)

  • Objective: Identify which GPOs were actually applied after the refresh and answer multiple-choice Q3.
  • Command: gpresult /R
  • Output – Applied GPO List
    • • IE Settings
    • • Deploy Printers
    • • Default Domain Policy
    • • Outlook Settings
  • Admin Tip
    • /R (summary) vs /H report.html (full HTML).
    • Combine with Resultant Set of Policy (RSoP) MMC snap-in for troubleshooting precedence/order.

Task 6 – Terminate a Hung Application (taskkill)

  • Objective: Find PID for Language application and stop it.
  • Sub-Steps
    1. Open Task ManagerDetails tab ➜ locate Language.exe.
    2. Noted PID: 6156.
    3. Execute: taskkill /PID 6156
    • Returns SUCCESS: Sent termination signal to process with PID 6156.
  • Conceptual Importance
    • taskkill can also use /F (force) and /IM <image.exe> for mass termination.
    • Remedy for unresponsive GUI applications, scripted clean-ups, or malware containment.

Task 7 – Map a Network Drive (net use)

  • Objective: Map drive P: to \corpfiles\personnel share.
  • Commands & Validation
    • net use P: \\corpfiles\personnelThe command completed successfully.
    • P: ➜ change to new drive.
    • dir ➜ shows three top-level folders.
  • Quiz Answer: There are 3 folders in the root of *P:*.
  • Real-World Link
    • Drive mapping centralizes departmental resources; can be automated via logon GPOs or scripted for temporary access.

Lab Wrap-Up

  • All embedded questions (4 total) answered correctly ➜ Score 100 %.
  • Workflow Recap
    • Performed file operations, DNS diagnostics, disk health check, Group Policy life-cycle, process management, and network drive mapping—all critical admin pillars.
  • Ethical / Practical Implications
    • Proper command usage avoids accidental data loss (e.g. copy vs move, taskkill without /F).
    • DNS enumeration should respect privacy & security policies.
    • Mapping drives may expose sensitive data; follow least-privilege and audit access regularly.

Quick Reference – Commands Used

  • E: / D: – Change active drive.
  • md <folder> / mkdir <folder> – Make directory.
  • copy <src> <dest> – Copy files.
  • dir – List directory contents.
  • nslookup <FQDN> – Query DNS.
  • chkdsk <volume> – Check disk integrity.
  • gpupdate – Force GP refresh.
  • gpresult /R – Display Resultant Set of Policy (summary).
  • taskkill /PID <id> – Terminate process by PID.
  • net use <drive>: <\\server\share> – Map network drive.

Suggested Next Steps / Further Study

  • Automate similar tasks with PowerShell scripting to scale across multiple machines.
  • Explore Get-Service, Get-EventLog, and Set-ExecutionPolicy as complementary sysadmin tools.
  • Delve into Advanced Group Policy Management (AGPM) for change control on GPOs.
  • Practice robocopy for robust file transfers and diskpart for advanced volume management.