- PowerShell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| active-directory | ||
| azure | ||
| networking | ||
| windows | ||
| .gitignore | ||
| README.md | ||
SysAdmin Scripts
A curated collection of PowerShell scripts for Microsoft Windows, Active Directory, Microsoft Entra ID (Azure AD), Microsoft 365 and enterprise infrastructure administration.
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:
- Fork the repository
- Create a feature branch
- Submit a pull request
- 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/