PowerShell Scripts Every MSP Should Use
If you work in an MSP environment, you already know the truth: 👉 Repetitive tasks will slowly destroy your soul. Checking disk space Monitoring services Logging into multiple machines Fixing the same issues again and again At some point, you realize: “I’m not being paid to click the same thing 50 times.” That’s where PowerShell saves you. But… After a few “learning experiences” (a.k.a. breaking things in production 😅), I realized: 👉 Automation is powerful… but dangerous. So here are 5 PowerShell scripts every MSP should use —written in a safe, production-friendly way . 🛠️ 1. Disk Space Check (Prevent Tickets Before They Happen) This is one of the most common MSP issues. Instead of waiting for: “My computer is slow” You can detect problems early. ```powershell id="disk01" $computers = @
If you work in an MSP environment, you already know the truth:
👉 Repetitive tasks will slowly destroy your soul.
-
Checking disk space
-
Monitoring services
-
Logging into multiple machines
-
Fixing the same issues again and again
At some point, you realize:
“I’m not being paid to click the same thing 50 times.”
That’s where PowerShell saves you.
But…
After a few “learning experiences” (a.k.a. breaking things in production 😅), I realized:
👉 Automation is powerful… but dangerous.
So here are 5 PowerShell scripts every MSP should use—written in a safe, production-friendly way.
🛠️ 1. Disk Space Check (Prevent Tickets Before They Happen)
This is one of the most common MSP issues.
Instead of waiting for:
“My computer is slow”
You can detect problems early.
$computers = @("PC1","PC2","PC3")
foreach ($computer in $computers) {
try {
$disks = Get-CimInstance Win32_LogicalDisk -ComputerName $computer -Filter "DriveType=3"
`foreach ($disk in $disks) {
$freePercent = [math]::Round(($disk.FreeSpace / $disk.Size) * 100, 2)
if ($freePercent -lt 20) {
Write-Output "$computer - Low disk space on $($disk.DeviceID): $freePercent%"
}
}
}
catch {
Write-Output "Failed to check $computer"
}`
Enter fullscreen mode
Exit fullscreen mode
}
`👉 **Why this matters:**
You fix issues *before* users notice.
---
# 🔄 2. Safe Restart Script (No More Accidental Chaos)
Let’s be honest…
👉 We’ve all restarted the wrong machine at least once.
Here’s a safer version:
```powershell id="restart01"
$computers = @("PC1","PC2")
foreach ($computer in $computers) {
if (Test-Connection -ComputerName $computer -Count 1 -Quiet) {
Restart-Computer -ComputerName $computer -WhatIf
} else {
Write-Output "$computer is offline"
}
}`
Enter fullscreen mode
Exit fullscreen mode
👉 Key feature: -WhatIf
This shows what would happen without actually doing it.
## 🧠 3. Service Health Check (Catch Hidden Problems)
Some services fail silently.
This script helps you detect them quickly:
```powershell id="service01"
$services = @("Spooler","W32Time")
foreach ($service in $services) {
$status = Get-Service -Name $service
`if ($status.Status -ne "Running") {
Write-Output "$service is NOT running"
}`
Enter fullscreen mode
Exit fullscreen mode
}
`👉 **Upgrade idea:** Automatically restart failed services (carefully!)
---
# 🔐 4. Local Admin Audit (Security Must-Have)
This is huge for cybersecurity.
You should always know:
👉 **Who has admin access?**
```powershell id="admin01"
$admins = Get-LocalGroupMember -Group "Administrators"
foreach ($admin in $admins) {
Write-Output $admin.Name
}`
Enter fullscreen mode
Exit fullscreen mode
👉 Why this matters:
Unauthorized access = major security risk
## 📋 5. Script Logging (The Thing Everyone Skips 😅)
This is not optional.
Seriously.
```powershell id="log01"
Start-Transcript -Path "C:\Logs\msp_script.log"
Write-Output "Script started..."
## Your script here
Write-Output "Script completed."
Stop-Transcript
`👉 **Why this matters:**
* Debug faster
* Track actions
* Prove what happened
---
# ⚠️ The Most Important Rule
All these scripts are useful.
But the real difference is:
👉 **How you run them**
---
## 🧠 My Safety Checklist (Always Follow This)
Before running any script:
* Use `-WhatIf` whenever possible
* Test on ONE machine first
* Check permissions
* Add logging
* Assume something will fail
---
# 😂 Real Talk
PowerShell doesn’t make mistakes.
👉 **We do.**
PowerShell just executes our bad ideas… very efficiently.
---
# 🚀 Final Thought
If you use these scripts correctly:
* You save hours
* You reduce errors
* You look like a hero
If you use them incorrectly:
👉 You create a story for your next blog post 😅
---
# 👇 Your turn
* What’s your go-to PowerShell script?
* Ever automated something that went… very wrong?
Let’s share 👇`
Enter fullscreen mode
Exit fullscreen mode*
$computers = @("PC1","PC2","PC3")
foreach ($computer in $computers) {
try {
$disks = Get-CimInstance Win32_LogicalDisk -ComputerName $computer -Filter "DriveType=3"
`foreach ($disk in $disks) {
$freePercent = [math]::Round(($disk.FreeSpace / $disk.Size) * 100, 2)
if ($freePercent -lt 20) {
Write-Output "$computer - Low disk space on $($disk.DeviceID): $freePercent%"
}
}
}
catch {
Write-Output "Failed to check $computer"
}`
Enter fullscreen mode
Exit fullscreen mode
}
`👉 **Why this matters:**
You fix issues *before* users notice.
---
# 🔄 2. Safe Restart Script (No More Accidental Chaos)
Let’s be honest…
👉 We’ve all restarted the wrong machine at least once.
Here’s a safer version:
```powershell id="restart01"
$computers = @("PC1","PC2")
foreach ($computer in $computers) {
if (Test-Connection -ComputerName $computer -Count 1 -Quiet) {
Restart-Computer -ComputerName $computer -WhatIf
} else {
Write-Output "$computer is offline"
}
}`
Enter fullscreen mode
Exit fullscreen mode
👉 Key feature: -WhatIf
This shows what would happen without actually doing it.
## 🧠 3. Service Health Check (Catch Hidden Problems)
Some services fail silently.
This script helps you detect them quickly:
```powershell id="service01"
$services = @("Spooler","W32Time")
foreach ($service in $services) {
$status = Get-Service -Name $service
`if ($status.Status -ne "Running") {
Write-Output "$service is NOT running"
}`
Enter fullscreen mode
Exit fullscreen mode
}
`👉 **Upgrade idea:** Automatically restart failed services (carefully!)
---
# 🔐 4. Local Admin Audit (Security Must-Have)
This is huge for cybersecurity.
You should always know:
👉 **Who has admin access?**
```powershell id="admin01"
$admins = Get-LocalGroupMember -Group "Administrators"
foreach ($admin in $admins) {
Write-Output $admin.Name
}`
Enter fullscreen mode
Exit fullscreen mode
👉 Why this matters:
Unauthorized access = major security risk
## 📋 5. Script Logging (The Thing Everyone Skips 😅)
This is not optional.
Seriously.
```powershell id="log01"
Start-Transcript -Path "C:\Logs\msp_script.log"
Write-Output "Script started..."
## Your script here
Write-Output "Script completed."
Stop-Transcript
`👉 **Why this matters:**
* Debug faster
* Track actions
* Prove what happened
---
# ⚠️ The Most Important Rule
All these scripts are useful.
But the real difference is:
👉 **How you run them**
---
## 🧠 My Safety Checklist (Always Follow This)
Before running any script:
* Use `-WhatIf` whenever possible
* Test on ONE machine first
* Check permissions
* Add logging
* Assume something will fail
---
# 😂 Real Talk
PowerShell doesn’t make mistakes.
👉 **We do.**
PowerShell just executes our bad ideas… very efficiently.
---
# 🚀 Final Thought
If you use these scripts correctly:
* You save hours
* You reduce errors
* You look like a hero
If you use them incorrectly:
👉 You create a story for your next blog post 😅
---
# 👇 Your turn
* What’s your go-to PowerShell script?
* Ever automated something that went… very wrong?
Let’s share 👇`
Enter fullscreen mode
Exit fullscreen mode*
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products

Voice AI Agents: Building Speech-to-Speech Apps with TypeScript
Voice AI Agents: Building Speech-to-Speech Apps with TypeScript Voice is the most natural interface for AI. In 2026, speech-to-speech applications are transforming customer service, virtual assistants, and real-time translation. But building voice AI pipelines traditionally requires stitching together multiple SDKs: one for Speech-to-Text (STT), another for LLM inference, and a third for Text-to-Speech (TTS). NeuroLink unifies this entire pipeline into a single TypeScript SDK. In this guide, you'll learn how to build real-time voice AI agents using NeuroLink's streaming architecture. We'll cover speech-to-text integration, streaming LLM responses, text-to-speech synthesis, and practical patterns for production voice applications. Why Voice AI Is Hard (And How NeuroLink Solves It) Building






Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!