A collection of PowerShell automation scripts for enterprise Windows and Azure environments. These scripts are used in production to monitor system health, automate routine tasks, and ensure infrastructure reliability.
These scripts help businesses:
- Prevent costly downtime through proactive monitoring and early detection
- Reduce manual IT labor by 60-80% through intelligent automation
- Lower cloud costs by identifying unused resources and optimizing spending
- Ensure compliance with automated audit reporting and documentation
- Scale infrastructure without hiring additional IT staff
Used in production by SaaS companies, healthcare providers, and financial institutions managing 100-10,000+ users.
This repository contains automation tools I've developed while managing enterprise infrastructure for clients across banking, healthcare, and SaaS industries. Each script is designed to be:
- Production-ready - Error handling, logging, email notifications
- Modular - Easy to customize for different environments
- Well-documented - Clear comments and usage examples
- Security-focused - Credential management, audit logging
Purpose: Comprehensive Active Directory health monitoring
Features:
- Checks domain controller replication status
- Validates FSMO role holders
- Tests DNS resolution and zone health
- Monitors SYSVOL/NETLOGON replication
- Sends email alerts on failures
Use Case: Daily automated monitoring for multi-site AD environments
.\AD-HealthCheck.ps1 -Domain "contoso.local" -EmailTo "admin@company.com"Purpose: Monitor Veeam backup job status and alert on failures
Features:
- Queries Veeam Backup & Replication job history
- Identifies failed, warning, or missing backups
- Generates detailed HTML report
- Sends email alerts to administrators
- Logs all checks for audit trail
Use Case: Nightly backup verification for disaster recovery compliance
.\Backup-Monitor.ps1 -VeeamServer "backup01" -EmailTo "backup-team@company.com"Purpose: Generate comprehensive Azure resource inventory with cost analysis
Features:
- Lists all resources across subscriptions
- Calculates current month costs per resource
- Identifies unused or underutilized resources
- Exports to CSV for further analysis
- Tracks resource tags and compliance
Use Case: Monthly cost optimization and resource governance
.\Azure-ResourceInventory.ps1 -SubscriptionId "xxxx-xxxx-xxxx-xxxx"Purpose: Monitor SSL/TLS certificate expiration dates
Features:
- Scans IIS bindings for certificates
- Checks Exchange certificate expiration
- Monitors domain controller certificates
- Sends alerts 30/15/7 days before expiry
- Generates compliance report
Use Case: Prevent certificate-related outages in production
.\Certificate-ExpiryMonitor.ps1 -AlertThresholdDays 30Purpose: Standardized Active Directory user account creation
Features:
- Creates user with proper OU placement
- Assigns security groups based on department
- Sets Exchange mailbox attributes
- Configures home drive and profile path
- Sends welcome email with credentials
Use Case: HR onboarding automation with consistent security policies
.\User-ProvisioningTemplate.ps1 -FirstName "John" -LastName "Doe" -Department "IT"- Windows PowerShell 5.1 or PowerShell 7+
- Active Directory PowerShell Module (for AD scripts)
- Azure PowerShell Module (for Azure scripts)
- Veeam PowerShell Snap-in (for backup scripts)
- Appropriate administrative permissions
- Clone this repository:
git clone https://github.com/Naveen032506/Infrastructure-Automation.git
cd Infrastructure-Automation- Review and customize parameters in each script
- Configure email settings in the configuration section
- Test in non-production environment first
Each script has a configuration section at the top. Key settings:
# Email Configuration
$SmtpServer = "smtp.company.com"
$EmailFrom = "automation@company.com"
$EmailTo = "admin@company.com"
# Logging
$LogPath = "C:\Logs\Automation"- Store credentials using
Get-Credentialand Windows Credential Manager - Run scripts with least-privilege service accounts
- Enable PowerShell script logging for audit trails
- Review execution policies and code signing requirements
- Sanitize any sensitive data before logging
These scripts are actively used in production environments:
- Revalize LLC (SaaS): Daily AD health checks, nightly backup monitoring, monthly Azure cost reports
- Enterprise Banking Client: Certificate monitoring across 50+ servers
- Healthcare Provider: Automated user provisioning for 1,000+ staff
This repository represents production automation from real enterprise environments. If you have suggestions or improvements:
- Fork the repository
- Create a feature branch
- Submit a pull request with clear description
MIT License - Feel free to use and modify for your own infrastructure automation needs.
Naveen - Senior IT Consultant
- 10+ years managing enterprise infrastructure
- Specialist in Azure, Active Directory, PowerShell automation
- Top Rated Plus on Upwork with 100% Job Success Score
For questions about these scripts or custom automation needs:
Last updated: April 2026