A comprehensive PowerShell-based assessment tool for Azure environments that combines cost optimization, security analysis, and compliance checking in one automated report.
- β Identifies unattached disks and associated costs
- β Finds unused public IP addresses
- β Detects stopped (but not deallocated) VMs
- β Identifies Azure Hybrid Benefit opportunities
- β Analyzes license utilization and waste
- β Calculates potential monthly and annual savings
- π Global Administrator Analysis - Identifies excessive admin accounts
- π Privileged Identity Management (PIM) - Checks if PIM is enabled
- π Multi-Factor Authentication (MFA) - Analyzes MFA coverage
- π Conditional Access Policies - Reviews CA policy configuration
- π Network Security Groups - Flags risky NSG rules
- π Storage Security - Identifies insecure storage accounts
- π Backup Coverage - Finds VMs without backup protection
- π Monitoring Status - Checks VM monitoring configuration
- π³ License Analysis - Identifies unused and underutilized licenses
- π³ Cost Breakdown - Estimates monthly waste by license type
- π Feature Detection - Identifies underutilized Azure features
- Microsoft Defender for Cloud
- Azure Policy
- Azure Blueprints
- Log Analytics
- Conditional Access
- π Subscription Discovery - Lists all accessible subscriptions
- β Permission Verification - Validates user has proper access
- π Multi-Subscription Support - Check permissions across all subscriptions
# Core Azure module
Install-Module -Name Az -Force -AllowClobber
# Azure AD modules (for identity and license checks)
Install-Module -Name AzureAD -Force -AllowClobber
Install-Module -Name AzureADPreview -Force -AllowClobber # For PIM features- Minimum: Reader role on subscription
- Recommended: Reader + Security Reader
- For Full Assessment: Global Reader or equivalent in Azure AD
- Azure AD Free: Basic security checks
- Azure AD Premium P1: Conditional Access policies
- Azure AD Premium P2: Privileged Identity Management (PIM)
# Connect to Azure subscription
Connect-AzAccount
# Connect to Azure AD (for identity and license checks)
Connect-AzureAD# Verify you have access
.\Complete-Azure-Assessment.ps1 -CheckPermissions
# Check all subscriptions
.\Complete-Azure-Assessment.ps1 -SearchAllSubscriptions -CheckPermissions# Run full assessment
.\Complete-Azure-Assessment.ps1 -ClientName "YourClientName"
# Run on specific subscription
.\Complete-Azure-Assessment.ps1 -ClientName "YourClientName" -SubscriptionId "your-subscription-id"| Check | Impact | Action |
|---|---|---|
| Unattached Disks | $20-500/month | Delete after 30 days |
| Unused Public IPs | $10-100/month | Remove immediately |
| Stopped VMs | $50-500/month | Deallocate or delete |
| Azure Hybrid Benefit | $100-1000/month savings | Enable AHB |
| Unused Licenses | $50-500/month | Remove quarterly |
| Check | Risk Level | Compliance Impact |
|---|---|---|
| Global Admins >5 | Critical | SOC 2, ISO 27001 |
| PIM Not Enabled | Critical | Privileged access requirement |
| Risky NSG Rules | Critical | Security breach risk |
| No MFA | Critical | Account compromise |
| No Backups | High | Data loss risk |
| Insecure Storage | High | Data exposure |
| Check | Benefit |
|---|---|
| Global Admin Count | Security best practices |
| PIM Status | Just-in-time privileged access |
| MFA Coverage | 99.9% reduction in account compromise |
| Conditional Access | Zero Trust architecture |
| License Utilization | Cost optimization |
The assessment generates a comprehensive package with:
- Master-Assessment-Report.md - Complete findings and recommendations
- summary.json - Machine-readable summary for automation
- Global-Administrators.csv - All Global Admin accounts
- Conditional-Access-Policies.csv - CA policy details
- VMs-Without-Backup.csv - Backup coverage gaps
- Risky-NSG-Rules.csv - Security rules to remediate
- Insecure-Storage.csv - Storage security issues
- Unattached-Disks.csv - Orphaned disks with costs
- Unused-PublicIPs.csv - Unused IPs to remove
- Stopped-VMs.csv - VMs to deallocate
- Azure-HybridBenefit.csv - AHB savings opportunities
- License-Analysis.csv - License utilization and waste
- All-Subscriptions.csv - All accessible subscriptions
- Permission-Check-Results.csv - Access verification results
All files are packaged in a ZIP archive for easy download and sharing.
.\Complete-Azure-Assessment.ps1 -ClientName "Contoso"# First, discover all subscriptions
.\Complete-Azure-Assessment.ps1 -SearchAllSubscriptions
# Check permissions across all subscriptions
.\Complete-Azure-Assessment.ps1 -SearchAllSubscriptions -CheckPermissions
# Run assessment on specific subscription
.\Complete-Azure-Assessment.ps1 -ClientName "Contoso" -SubscriptionId "12345678-1234-1234-1234-123456789abc"# Check if you can run the assessment
.\Complete-Azure-Assessment.ps1 -CheckPermissions
# No assessment runs, just permission verificationββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ASSESSMENT COMPLETE β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π FINDINGS SUMMARY:
π° Cost Savings:
Monthly Savings: $850
Annual Savings: $10,200
π Security & Identity:
Global Admins: 3 β
PIM Enabled: β Yes
Critical Issues: 2
π³ License Optimization:
Unused Licenses: 15
Potential Savings: $180/month
π Underutilized Features: 3
π¦ ZIP FILE READY:
~/clouddrive/AzureAssessments/Contoso-Assessment-20251111-1430.zip
- Automatic prioritization of critical security issues
- Compliance framework mapping (SOC 2, ISO 27001, NIST)
- Risk-based recommendations
- Monthly and annual savings calculations
- ROI analysis with payback period
- 3-year net benefit calculations
Four-phase approach:
- Week 1: Quick wins (cost savings)
- Week 2: Security remediation
- Weeks 3-4: Optimization
- Month 2: Advanced security features
- Quick Start Guide - Getting started tutorial
- Security Assessment Guide - Detailed security features
- Security Quick Reference - Quick lookup guide
- Permission Check Guide - Subscription and access management
- Identifies all Global Admin accounts
- Recommends limiting to 2-4 accounts
- Detects emergency access accounts
- Tracks last sign-in activity
- Checks if PIM is enabled
- Counts eligible role assignments
- Recommends just-in-time access
- Requires Azure AD Premium P2
- Analyzes all Microsoft cloud licenses
- Identifies unused licenses and waste
- Calculates monthly and annual costs
- Provides right-sizing recommendations
- Supports:
- Azure AD Premium (P1/P2)
- Microsoft 365 (E3/E5)
- Office 365
- EMS (E3/E5)
- Power BI Pro
- Project/Visio
- Lists all CA policies
- Shows enabled vs. disabled status
- Recommends core policies:
- Require MFA for all users
- Block legacy authentication
- Require compliant devices
- Risk-based controls
- MSPs/CSPs - Multi-client Azure assessments
- IT Consultants - Client environment analysis
- Azure Administrators - Regular optimization reviews
- Security Teams - Compliance and security audits
- Finance Teams - Cost optimization initiatives
- Quick client environment assessment
- Professional, branded reports
- Identifies upsell opportunities
- Demonstrates value
- Regular optimization reviews
- Compliance documentation
- Cost savings identification
- Security posture improvement
- Automated compliance checks
- Audit-ready documentation
- Historical trending
- Executive summaries
The script can be customized to:
- Adjust cost estimates for different regions
- Modify security thresholds
- Add custom checks
- Integrate with ticketing systems
- Export to different formats
Contributions are welcome! Please feel free to submit a Pull Request.
See LICENSE file for details.
For issues, questions, or contributions:
- Check the documentation in the repository
- Review existing issues
- Create a new issue with details
- β¨ Added Global Administrator analysis
- β¨ Added Privileged Identity Management (PIM) checks
- β¨ Added Multi-Factor Authentication (MFA) coverage analysis
- β¨ Added Conditional Access policy review
- β¨ Added comprehensive license optimization
- β¨ Added underutilized features detection
- β¨ Added subscription discovery and permission checks
- π¨ Enhanced reporting with security scoring
- π Added detailed identity and access management section
- Initial release with cost optimization
- Basic security checks
- Network security analysis
- Backup coverage assessment
For professional services or custom assessments, please contact Managed Solution LLC.
Built with β€οΈ for Azure optimization and security