RepositoryPowerShell
socaldavis

socaldavis/powershell-for-sysadmins

Real sysadmin PowerShell scripts from the PC-Addicts YouTube channel — sanitized, parameterized, MIT. Steal these.

66stars
11forks
0issues
0views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: group-policy

#1 Repository of the month

1
TINIX TRENDING·Topic: windows-server

#1 Repository of the month

1
TINIX TRENDING·Topic: sysadmin

#1 Repository of the month

PC-Addicts PowerShell Library — "steal these"

Real sysadmin PowerShell from 13 years on the job, rewritten from the ground up to be generic, parameterized, and safe to run in your environment. These are the cleaned-up versions of the scripts shown on the PC-Addicts YouTube channel — the originals were written to get the job done; these are what they should have looked like.

Written walkthroughs for every script: pc-addicts.com — the PowerShell Script Library

Ground rules

  • Sanitized by construction. Everything here was rewritten from scratch for teaching — no real host names, domains, IPs, emails, or employer anything. Examples use the lab domain corp.example.lab and generic names like DC01, FS01. Swap in your own values.
  • Lab-first. Test in a lab before pointing anything at production. Destructive scripts support -WhatIf / -Confirm — use them first.
  • Original work only. Genuinely useful scripts written by others (e.g. Brian Wilhite's PendingReboot module) are not republished here; where a script covers the same ground as a community classic, it's an independent implementation and the file says so. The blog posts link to and credit the original authors.
  • Reviewed, but no warranty. Teaching examples, provided as-is. Read them, understand them, test them.

The series library (Sr. SysAdmin PowerShell, eps 1–6 + profile)

FolderScripts
ad/Get-InactiveADComputer · Disable-InactiveADUser · Copy-ADUser · Test-ADCredential · Sync-HRUserToAD (nightly HR-export → AD sync skeleton)
gpo/Find-GPOBySetting — search every GPO in the domain for a string
monitoring/Get-LoggedOnUser · Get-Uptime · Get-PendingReboot · Get-DiskFreeSpace
network/Start-PingLogger (log dropped connections) · Test-Subnet (fast /24 sweep)
files/Remove-OldFile — retention cleanup for backup folders
reporting/Export-FolderAcl — NTFS permissions audit to CSV
profile/profile.ps1 + PCAddicts.Tools.psm1 — profile and personal-module templates

The classics (root of the repo)

The original "steal these" set from the My Favorite PowerShell Scripts video — kept with the exact names the post uses:

ScriptWhat it does
Get-LoggedIn.psm1Who is currently logged into a computer (pipeline-friendly).
Get-Uptime.psm1Uptime + last boot time for one or many computers.
Disable-UnusedADAccounts.ps1Find and disable AD users inactive for N days, with an audit stamp and -WhatIf.
Get-DiskSpace.ps1Emailed HTML disk-space report (with RAM/CPU/build date) across a server list.
New-ADUsersFromCsv.ps1Bulk-create AD users from a CSV, temp password + change-at-logon, -WhatIf.

Conventions

  • Windows PowerShell 5.1 compatible (PS 7 differences noted in comments).
  • [CmdletBinding()], comment-based help, approved verbs on everything — Get-Help .\Get-Uptime.ps1 -Full works on every file.
  • Objects out, not text — pipe to Export-Csv, Where-Object, whatever you need.
  • Every file ends with a commented-out example, so pasting a whole file changes nothing.

Using them

# Dot-source a .ps1 to load its function, then run it:
. .\ad\Disable-InactiveADUser.ps1
Disable-InactiveADUser -DaysInactive 180 -WhatIf

# Or import a module:
Import-Module .\profile\PCAddicts.Tools.psm1
Get-CDUptime -ComputerName DC01

License

MIT — see LICENSE. Use them, ship them, teach with them. Credit appreciated, not required.

Similar Projects

Discover other similar projects and AI models.

RepositoryPowerShell
fleschutz/PowerShell

600+ free PowerShell scripts (.ps1) for Linux, macOS, and Windows.

3.3k
Dec 1, 2026
RepositoryPowerShell
AutomatedLab/AutomatedLab

AutomatedLab is a provisioning solution and framework that lets you deploy complex labs on HyperV and Azure with simple PowerShell scripts. It supports all Windows operating systems from 2008 R2 to 2022, some Linux distributions and various products like AD, Exchange, PKI, IIS, etc.

2.2k
Nov 23, 2026
RepositoryPowerShell
scriptrunner/ActionPacks

Public PowerShell script gallery for ScriptRunner.

725
Nov 13, 2026
RepositoryPowerShell
unkn0wnvariable/PowerShell-WindowsAdmin

A collection of scripts I've created over the years to administer things.

75
Sep 10, 2026
RepositoryC#
chocolatey/choco

Chocolatey - the package manager for Windows

11.6k
Nov 20, 2026
RepositoryPython
byt3bl33d3r/CrackMapExec

A swiss army knife for pentesting networks

9.2k
Dec 6, 2023
RepositoryC#
MichaelGrafnetter/DSInternals

Directory Services Internals (DSInternals) PowerShell Module and Framework

2.0k
Oct 12, 2026
RepositoryHTML
nsacyber/Windows-Secure-Host-Baseline

Configuration guidance for implementing the Windows 10 and Windows Server 2016 DoD Secure Host Baseline settings. #nsacyber

1.6k
Dec 24, 2022
RepositoryPython
cogiceo/GPOHound

Offensive GPO dumping and analysis tool that leverages and enriches BloodHound data

437
Nov 16, 2026