Skip to content

MahmoudNoureddine/SysAdmin-PS-Toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› οΈ SysAdmin-PS-Toolkit

A collection of 25 production-ready PowerShell scripts for Windows system administrators β€” covering diagnostics, monitoring, security, maintenance, and automation.

PowerShell Platform License Scripts


πŸ“‹ Table of Contents


Overview

SysAdmin-PS-Toolkit is a complete library of PowerShell scripts designed to streamline common IT administration tasks on Windows environments. Each script is:

  • βœ… Self-documented with .SYNOPSIS, .DESCRIPTION, and .EXAMPLE headers
  • βœ… Built with try/catch error handling throughout
  • βœ… Safe by default β€” destructive scripts run in preview mode unless explicitly confirmed
  • βœ… Logging-enabled for auditing and troubleshooting
  • βœ… Runnable standalone β€” no external dependencies or modules required

Requirements

Requirement Details
PowerShell Version 5.1 or higher ($PSVersionTable.PSVersion)
OS Windows 10 / Windows 11 / Windows Server 2016+
Privileges Most scripts run as standard user; some require Administrator (noted per script)

Getting Started

1. Clone the repository

git clone https://github.com/YOUR-USERNAME/SysAdmin-PS-Toolkit.git
cd SysAdmin-PS-Toolkit

2. Allow script execution (if not already set)

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

3. Run any script

.\SystemInventory.ps1

4. Get help for any script

Get-Help .\SystemInventory.ps1 -Full

Scripts

πŸ” Diagnostics & Reporting

Script Description Admin Required
SystemInventory.ps1 Gathers hardware specs, OS version, installed software, and network configuration into a full inventory report ⚠️ Recommended
DiskSpaceReporter.ps1 Checks available disk space on all drives, identifies largest files and folders, flags low-space warnings ❌
NetworkDiagnostics.ps1 Tests connectivity, DNS resolution, ping tests, and verifies full IP configuration ❌
EventLogAnalyzer.ps1 Pulls and summarizes Error/Critical events from System, Application, and Security logs ⚠️ Security log
PerformanceMonitor.ps1 Samples CPU, memory, and disk I/O metrics over a configurable period; identifies top resource-consuming processes ❌
SystemReportGenerator.ps1 One-click comprehensive system report combining inventory, disk, events, performance, and software into a single output ⚠️ Recommended

πŸ” Security & User Management

Script Description Admin Required
PasswordResetUtility.ps1 Interactive menu for changing passwords (with strength validation), unlocking accounts, and viewing account status ⚠️ To manage others
PasswordPolicyEnforcer.ps1 Audits and enforces local password policy settings β€” complexity, length, expiry, lockout thresholds βœ… Always
USBDeviceBlocker.ps1 Enables or disables USB storage device access via registry and Group Policy. Preview mode by default βœ… Always
FirewallConfigurator.ps1 Manages Windows Firewall rules β€” add, remove, enable/disable, and export firewall config βœ… Always
AntivirusStatusChecker.ps1 Reports Windows Defender / AV status, last scan time, definition age, and real-time protection state βœ… Recommended
Get-LocalAdminReport.ps1 Audits local Administrators group membership across remote computers β€” detects unauthorized local admins βœ… Always

🌐 Connectivity & Configuration

Script Description Admin Required
NetworkDriveConnector.ps1 Maps predefined network drives with credential fallback, checks VPN status, and tests share reachability ❌
PrinterInstaller.ps1 Installs network printers by IP or hostname, sets default printer, and removes stale printer entries βœ… Always

🧹 Maintenance

Script Description Admin Required
ProfileCleanup.ps1 Removes temp files, browser caches, prefetch, and Recycle Bin contents. Runs in preview mode by default ⚠️ Full cleanup
TempFileCleaner.ps1 Cleans Windows temp folders, WinSxS backup files, and CBS logs to reclaim disk space βœ… Always
DeviceDriverUpdater.ps1 Scans for outdated or missing drivers using Windows Update and PnP utilities βœ… Always
Watch-DiskSpace.ps1 Continuous disk space monitor with configurable warning and critical thresholds β€” live color-coded dashboard ❌

πŸ“¦ Software Management

Script Description Admin Required
WindowsUpdateChecker.ps1 Scans for pending Windows Updates using the WUA API, lists severity and KB numbers, optionally triggers downloads ⚠️ Recommended
SoftwareInventory.ps1 Lists all installed applications (64-bit, 32-bit, AppX) with versions and publishers; supports approved-list compliance checks ❌
ApplicationInstaller.ps1 Installs applications silently via Winget or direct installer β€” supports bulk install from a config list βœ… Always
SoftwareUninstaller.ps1 Uninstalls applications by name with confirmation β€” supports wildcard matching and bulk removal βœ… Always

βš™οΈ Remote Administration

Script Description Admin Required
Invoke-RemoteCommand.ps1 Run any PowerShell command or script file on one or multiple remote machines in parallel via WinRM βœ… Always
Get-ScheduledTaskReport.ps1 Audits scheduled tasks across local/remote machines β€” flags non-Microsoft and suspicious tasks βœ… Always
New-LocalUserProvision.ps1 Creates and configures local user accounts on remote machines β€” supports bulk CSV provisioning βœ… Always

Legend: βœ… = Always required Β  ⚠️ = Recommended Β  ❌ = Not required


Usage Examples

# Full system inventory with CSV export
.\SystemInventory.ps1 -OutputPath "C:\Reports" -ExportCSV

# Find top 30 largest files on D: drive
.\DiskSpaceReporter.ps1 -DriveLetter D -TopN 30

# Run network diagnostics against custom targets
.\NetworkDiagnostics.ps1 -PingTargets "192.168.1.1","10.0.0.1","google.com"

# Analyze last 48 hours of event logs
.\EventLogAnalyzer.ps1 -HoursBack 48 -MaxEvents 1000

# Monitor performance for 2 minutes
.\PerformanceMonitor.ps1 -DurationSeconds 120 -IntervalSeconds 10

# Preview what ProfileCleanup would delete (no files removed)
.\ProfileCleanup.ps1

# Actually run the cleanup
.\ProfileCleanup.ps1 -Execute

# Audit local admins across an OU
.\Get-LocalAdminReport.ps1 -OUPath "OU=Workstations,DC=corp,DC=local" -FlagDomainUsers

# Run a command on multiple remote machines in parallel
.\Invoke-RemoteCommand.ps1 -ComputerName "PC01","PC02","PC03" -Command "Get-Service Spooler"

# Audit scheduled tasks and flag suspicious ones
.\Get-ScheduledTaskReport.ps1 -ComputerName "Server01" -FlagSuspicious -NonMicrosoftOnly

# Live disk space monitor with custom thresholds
.\Watch-DiskSpace.ps1 -ComputerName "FileServer" -WarnPercent 25 -CritPercent 10 -IntervalSec 120

# One-time disk snapshot
.\Watch-DiskSpace.ps1 -Snapshot -OutputPath "C:\Reports"

# Create a local kiosk account on a remote machine
.\New-LocalUserProvision.ps1 -ComputerName "Kiosk01" -Username "kiosk" -FullName "Kiosk Account" -AddToGroup "Users"

# Bulk provision local accounts from CSV
.\New-LocalUserProvision.ps1 -CSVPath "C:\LocalUsers.csv"

# Software inventory with approved apps check
.\SoftwareInventory.ps1 -IncludeStoreApps -ApprovedListPath "C:\Config\approved_apps.txt"

Safety & Best Practices

  • Preview before executing β€” Scripts like ProfileCleanup.ps1 and USBDeviceBlocker.ps1 default to dry-run mode. Always review output before passing -Execute.
  • Test in a non-production environment first β€” Validate scripts on a test machine before wide deployment.
  • Run with least privilege β€” Only elevate to Administrator when a script explicitly requires it.
  • Review configurable sections β€” Scripts like NetworkDriveConnector.ps1 contain a # CONFIGURE YOUR DRIVES HERE block that must be updated for your environment.
  • WinRM required for remote scripts β€” Invoke-RemoteCommand.ps1, Get-LocalAdminReport.ps1, Get-ScheduledTaskReport.ps1, and New-LocalUserProvision.ps1 require WinRM enabled on targets (Enable-PSRemoting).

Logging

Scripts that perform sensitive or destructive actions write audit logs automatically:

Script Log File
PasswordResetUtility.ps1 PasswordReset_Audit.log
NetworkDriveConnector.ps1 NetworkDrives_Audit.log
ProfileCleanup.ps1 ProfileCleanup_<timestamp>.txt
Get-LocalAdminReport.ps1 LocalAdminReport_<timestamp>.log
Invoke-RemoteCommand.ps1 RemoteCommand_<timestamp>.log
New-LocalUserProvision.ps1 LocalUserProvision_<timestamp>.log
Watch-DiskSpace.ps1 DiskSpaceAlerts_<date>.log

All report-generating scripts save timestamped .txt and/or .csv files to your Desktop by default, or to any path specified with -OutputPath.


Contributing

Contributions are welcome! To add or improve a script:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-script-name
  3. Follow the existing script structure (header comments, error handling, logging)
  4. Submit a pull request with a clear description of what the script does

Please ensure all scripts follow these standards:

  • Full comment-based help block (.SYNOPSIS, .DESCRIPTION, .PARAMETER, .EXAMPLE, .NOTES)
  • try/catch for all major operations
  • Confirmation prompt before any destructive action
  • Tested on Windows 10 and Windows 11

License

This project is licensed under the MIT License.


Made for IT teams who'd rather automate than repeat themselves.

About

PowerShell scripts for Windows system administration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors