PowerShell scripts for System Administration, Active Directory, Microsoft 365, Azure and Infrastructure Automation. https://git.ruiguimaraes.net/it-tools/sysadmin-scripts/
  • PowerShell 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-03 10:15:42 +01:00
active-directory Fix SysAdmin tools PowerShell menu 2026-09-03 10:15:42 +01:00
azure Fix SysAdmin tools PowerShell menu 2026-09-03 10:15:42 +01:00
networking Update author title across scripts and documentation 2026-07-30 18:59:29 +01:00
reports Add global SysAdmin tools menus 2026-09-02 23:57:16 +01:00
windows Update author title across scripts and documentation 2026-07-30 19:13:03 +01:00
.gitignore Add global SysAdmin tools menus 2026-09-02 23:57:16 +01:00
README.md Fix SysAdmin tools PowerShell menu 2026-09-03 10:15:42 +01:00
Show-SysAdminToolsMenu.ps1 Fix SysAdmin tools PowerShell menu 2026-09-03 10:15:42 +01:00

SysAdmin Scripts

A curated collection of PowerShell scripts for Microsoft Windows, Active Directory, Microsoft Entra ID (Azure AD), Microsoft 365 and enterprise infrastructure administration.

PowerShell Platform License Status


Overview

SysAdmin Scripts is a collection of production-ready PowerShell scripts designed to simplify common administration tasks in enterprise environments.

The project focuses on:

  • Active Directory administration
  • Microsoft Entra ID (Azure AD)
  • Microsoft 365
  • Windows Server
  • Security auditing
  • Reporting
  • Infrastructure automation

Every script is designed to be:

  • Modular
  • Well documented
  • Safe to execute
  • Easy to customise
  • Suitable for production environments

Repository Structure

sysadmin-scripts
│
├── active-directory/
│   ├── forest/
│   ├── gpo/
│   ├── health/
│   ├── security-audit/
│   └── users/
│
├── azure/
│   ├── entra/
│   └── security-audit/
│
├── networking/
│   └── nps/
│
├── windows/
│   └── maintenance/
│       ├── SystemDiskCleanup/
│       └── WindowsKBAudit/
│
└── README.md

Available Scripts

Active Directory

Script Description
Enable-ADRecycleBin Enables the Active Directory Recycle Bin
Get-ADHealth Generates a health report for Active Directory
DCAuditTool Modular DC audit tool with PowerShell menu and individual checks
Get-ADPrivilegedAccounts Lists privileged accounts and groups
Get-ADUser Retrieves user information from Active Directory

GPO baseline documentation, reports, backups and automation placeholders are maintained under active-directory/gpo/.


Microsoft Entra ID

Script Description
Force-AzureADSync Starts an Azure AD Connect synchronisation
Get-AzureADSecurityAudit Generates a security audit report

Windows

Script Description
Clear-SystemDisk Cleans temporary files and frees disk space
Collect-KBAudit Captures Windows KB state before/after monthly updates and generates an HTML customer report
Collect-KBAuditFleet Captures Windows KB state across multiple servers and generates one consolidated HTML customer report

Network Policy Server

Script Description
Configure-NpsApsFromExcel Imports Wireless Access Points into Microsoft NPS from Excel

Requirements

Depending on the script, the following PowerShell modules may be required:

  • ActiveDirectory
  • Microsoft.Graph
  • AzureAD (legacy)
  • ExchangeOnlineManagement
  • ImportExcel

Some scripts require:

  • Windows Server
  • Domain Administrator permissions
  • Global Administrator permissions
  • Local Administrator permissions

Refer to the documentation of each script for specific requirements.


Installation

Most customer servers and Domain Controllers do not have Git installed. Use this method when deploying the scripts directly on a server:

New-Item -ItemType Directory -Path C:\Tools -Force
cd C:\Tools

Invoke-WebRequest `
  -Uri "https://git.ruiguimaraes.net/it-tools/sysadmin-scripts/archive/main.zip" `
  -OutFile "C:\Tools\sysadmin-scripts-main.zip"

Expand-Archive `
  -Path "C:\Tools\sysadmin-scripts-main.zip" `
  -DestinationPath "C:\Tools" `
  -Force

Depending on the Git server archive naming, the extracted folder may be named sysadmin-scripts or sysadmin-scripts-main. Confirm the folder name:

Get-ChildItem C:\Tools

Then enter the repository folder:

cd C:\Tools\sysadmin-scripts

or:

cd C:\Tools\sysadmin-scripts-main

Option 2: Git clone

Use this method on admin workstations or servers where Git is already installed:

git clone https://git.ruiguimaraes.net/it-tools/sysadmin-scripts.git

Open PowerShell and execute the required script from the repository folder.

Example:

.\Get-ADHealth.ps1

Or use the global PowerShell menu from the repository root:

.\Show-SysAdminToolsMenu.ps1

Generated reports are stored under reports\<tool-name>\ whenever the global menus can control the output path. Report filenames include the executed verification/tool name, the local computer name and the timestamp.


Compatibility

Platform Supported
Windows 10
Windows 11
Windows Server 2019
Windows Server 2022
Windows Server 2025
PowerShell 5.1
PowerShell 7 (where supported by required modules)

Project Goals

  • Maintain high-quality administration scripts
  • Improve automation
  • Follow PowerShell best practices
  • Reduce repetitive administrative tasks
  • Keep scripts production-ready

Roadmap

Version 2.0

  • Standardised logging
  • Common helper module
  • PowerShell module support
  • CI/CD pipeline
  • Automated testing
  • PSScriptAnalyzer integration
  • Script signing support
  • Enhanced documentation
  • Markdown help generation

Contributing

Contributions are welcome.

If you wish to improve an existing script or add a new one:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request
  4. Follow the existing coding standards

Reporting Issues

Please use the issue tracker to report:

  • Bugs
  • Feature requests
  • Documentation improvements

License

This project is licensed under the MIT License.

See the LICENSE file for details.


Author

Rui Guimarães
Infrastructure & Cloud Engineer
Microsoft • Linux • Virtualization
https://git.ruiguimaraes.net/