A collection of reusable PowerShell and T-SQL scripts for enterprise infrastructure management.
| Folder | Version | Type | Description |
|---|---|---|---|
| Add-Named-Instances | 2.0.0 | PowerShell | Assigns SQL Server named instance service accounts to the required local security groups for CIS hardening. Creates missing groups automatically; verifies LSA rights via secedit. Supports -WhatIf. |
| CleanupPolicies | 1.4.0 | PowerShell | Inventories Group Policy Objects that are unlinked (not applied to any OU, site or domain container) or have no 'Apply Group Policy' Allow ACE, producing an Excel/CSV report for GPO cleanup reviews. |
| Compare-GPOsByOU | 1.6.0 | PowerShell | Reports all GPOs linked to each OU including link order, enabled/enforced state, WMI filter details, and orphaned GPOs. Supports DC pinning, parallel inheritance fetching on PS 7+, settings conflict detection, and -PassThru for pipeline use. |
| Generate-RDCManConfigs | 2.1.0 | PowerShell | Generates RDCMan (.rdg) configuration files for one or more Active Directory domains by querying enabled Windows Server objects and organising them into OU-mirrored groups. |
| Get-AllGPOSettings | 1.1.0 | PowerShell | Reports every configured setting in every GPO in a domain, regardless of where (or whether) each GPO is linked, including orphaned GPOs. Exports a single Excel/CSV "Settings" report with parallel report fetching on PS 7+ and -PassThru for pipeline use. |
| Get-ServiceAccounts | 1.8 | PowerShell | Scans all enabled Windows Server objects in Active Directory for non-standard accounts used by Windows services and scheduled tasks, exporting results to Excel and per-server CSV files. |
| Shared | 1.1.0 | PowerShell module | Shared logging (Initialize-ScriptLog, Write-ScriptLog, Remove-OldLog), module-import (Import-RequiredModule), and GPO XML report parsing (Get-XmlInnerText, Get-GpoSetting) utilities used by PowerShell scripts in this repository. |
| SQL-Create-ServiceNow-User | 1.0 | T-SQL | Provisions a Windows-authenticated SQL Server login and database user for the local <MachineName>\servicenow account, used by ServiceNow discovery and integration. |
Each folder contains:
- A
.sqlor.ps1script — the main executable. - A
.mdfile — full documentation (synopsis, prerequisites, usage, notes). - Additional supporting files where applicable (
.mmddiagrams, sample config, etc.).
Refer to the .md file in each folder for detailed instructions
before running any script.
- SQL scripts — SQL Server 2016 or later; SSMS or
sqlcmdfor execution. - PowerShell scripts — PowerShell 5.1 or PowerShell 7+; modules
listed per script.
- All PowerShell scripts depend on
Shared\PublicScripts.psm1(included in this repository) for shared logging utilities. Add-Named-Instancesrequires local administrator privileges (#Requires -RunAsAdministrator); no additional modules.CleanupPoliciesrequires theGroupPolicyandActiveDirectorymodules (RSAT); optionallyImportExcelfor.xlsxoutput.Compare-GPOsByOUrequires theGroupPolicyandActiveDirectorymodules (RSAT); optionallyImportExcelfor.xlsxoutput. Use-DomainControllerto pin all queries to a specific DC.Generate-RDCManConfigsrequires theActiveDirectorymodule (RSAT).Get-AllGPOSettingsrequires theGroupPolicymodule (RSAT); optionallyImportExcelfor.xlsxoutput. Use-DomainControllerto pin all queries to a specific DC.Get-ServiceAccountsrequires theActiveDirectorymodule (RSAT) andImportExcel; WMI/CIM access to target servers (WinRM preferred, DCOM fallback).
- All PowerShell scripts depend on