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-07-30 19:18:20 +01:00
active-directory Remove obsolete PatchReport attempt 2026-07-30 19:18:20 +01:00
azure Update author title across scripts and documentation 2026-07-30 19:13:03 +01:00
networking Update author title across scripts and documentation 2026-07-30 18:59:29 +01:00
windows Update author title across scripts and documentation 2026-07-30 19:13:03 +01:00
.gitignore docs(active-directory): establish Windows Server 2025 security baseline 2026-07-24 03:26:09 +01:00
README.md Remove obsolete PatchReport attempt 2026-07-30 19:18:20 +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
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

Clone the repository:

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

Open PowerShell and execute the required script.

Example:

.\Get-ADHealth.ps1

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/