HTML Reports¶
Generate interactive, self-contained HTML reports from NMM data with embedded charts, searchable tables, and Nerdio branding.
Features¶
- Self-contained HTML - Single file with embedded CSS, no external dependencies
- Interactive tables - Search, sort, and paginate with DataTables.js
- Charts - Bar, pie, donut, line, and area charts via ApexCharts
- Nerdio branding - Professional styling with embedded logo
- Dark/light themes - Match your preference
- Automatic templates - Smart column selection based on data type
- Pipeline-friendly - Works with PowerShell pipelines
Quick Start¶
Simple Pipeline Report¶
The fastest way to generate a report:
# Single data type report
Get-NMMDevice -AccountId 123 |
ConvertTo-NMMHtmlReport -Title "Device Report" -OutputPath "./devices.html" -OpenInBrowser
Multi-Section Dashboard¶
For comprehensive reports with multiple data types:
# Initialize report
$report = New-NMMReport -Title "Monthly AVD Report" -Subtitle "December 2024"
# Add sections
$report | Add-NMMReportSection -Title "Host Pools" -Data $hostPools -ShowChart -ChartType donut
$report | Add-NMMReportSection -Title "Session Hosts" -Data $hosts -ShowChart
$report | Add-NMMReportSection -Title "Devices" -Data $devices -ShowChart -ChartType pie
# Export
$report | Export-NMMReport -OutputPath "./monthly-report.html" -OpenInBrowser
Report Types¶
1. Simple Pipeline (ConvertTo-NMMHtmlReport)¶
Best for quick, single-section reports:
Get-NMMHostPool -AccountId 67 | ForEach-Object { $_.HostPool } |
ConvertTo-NMMHtmlReport -Title "Host Pools" -ShowChart -OutputPath "./hostpools.html"
2. Multi-Section Builder (New-NMMReport)¶
Best for dashboards combining multiple data types:
$report = New-NMMReport -Title "Infrastructure Dashboard"
$report | Add-NMMReportSection -Title "Host Pools" -Data $pools
$report | Add-NMMReportSection -Title "Backup Status" -Data $backups -ShowChart
$report | Export-NMMReport -OutputPath "./dashboard.html"
Supported Data Types¶
Reports automatically detect data types and apply appropriate templates:
| PSTypeName | Display Name | Default Chart | Group By Field |
|---|---|---|---|
NMM.HostPool |
Host Pool | Donut | isAutoScaleEnabled |
NMM.Host |
Session Host | Donut | powerState |
NMM.Device |
Intune Device | Pie | complianceState |
NMM.Account |
Account | None | - |
NMM.User |
User | None | - |
NMM.Backup |
Backup Item | Donut | protectionState |
Automatic Type Detection
Most Get-NMM* cmdlets automatically tag data with the correct PSTypeName. The report generator uses this to select the right columns and chart configuration.
Chart Types¶
Specify chart visualization with -ChartType:
| Type | Best For |
|---|---|
bar |
Comparing quantities across categories |
pie |
Showing parts of a whole (small datasets) |
donut |
Similar to pie with center space for totals |
line |
Trends over time |
area |
Cumulative values over time |
# Pie chart for compliance
Get-NMMDevice -AccountId 123 |
ConvertTo-NMMHtmlReport -Title "Compliance" -ShowChart -ChartType pie -OutputPath "./compliance.html"
# Donut chart for power states
$hosts | ConvertTo-NMMHtmlReport -Title "Host Status" -ShowChart -ChartType donut -OutputPath "./hosts.html"
Customization¶
Themes¶
Choose between light and dark themes:
Or with the simple pipeline:
Custom Logo¶
Replace the default Nerdio logo:
Footer Text¶
Customize the footer:
Metadata¶
Add report metadata:
$report = New-NMMReport -Title "Report" -Metadata @{
GeneratedBy = "Automation Script"
Environment = "Production"
Version = "1.0"
}
Output Options¶
Save to File¶
Save and Open in Browser¶
Return HTML String¶
Working with Custom Data¶
For data that doesn't come from NMM cmdlets, use Add-NMMTypeName:
# Custom data matching Host Pool schema
$customData = @(
[PSCustomObject]@{ hostPoolName = "Pool1"; resourceGroup = "RG1"; subscription = "Sub1"; isAutoScaleEnabled = $true }
[PSCustomObject]@{ hostPoolName = "Pool2"; resourceGroup = "RG2"; subscription = "Sub1"; isAutoScaleEnabled = $false }
)
$customData | Add-NMMTypeName -TypeName 'NMM.HostPool' |
ConvertTo-NMMHtmlReport -Title "Custom Host Pools" -ShowChart -OutputPath "./custom.html"
Pipeline Patterns¶
Using Splatting¶
For cleaner code, use parameter splatting:
$reportParams = @{
Title = "NMM Complete Report"
Subtitle = "Account ID: 67 - $(Get-Date -Format 'MMMM yyyy')"
Theme = "light"
}
$report = New-NMMReport @reportParams
$exportParams = @{
OutputPath = "./NMM-Complete-Report.html"
OpenInBrowser = $true
}
$report | Export-NMMReport @exportParams
Chaining with PassThru¶
Use -PassThru to chain multiple sections:
New-NMMReport -Title "Report" |
Add-NMMReportSection -Title "Pools" -Data $pools -PassThru |
Add-NMMReportSection -Title "Hosts" -Data $hosts -PassThru |
Add-NMMReportSection -Title "Users" -Data $users -PassThru |
Export-NMMReport -OutputPath "./chained.html"
Pre-built Reports¶
For common reporting scenarios, use Invoke-NMMReport to generate complete reports with a single command.
Quick Start¶
# Interactive mode - choose from menu
Invoke-NMMReport -AccountId 67
# Direct generation
Invoke-NMMReport -ReportType AccountOverview -AccountId 67 -OpenInBrowser
Available Report Types¶
| Report | Sections | Description |
|---|---|---|
AccountOverview |
4 | Host pools, session hosts, images, users |
DeviceInventory |
4 | Devices, compliance, hardware, apps |
SecurityCompliance |
3 | Devices, backup protection, users |
Infrastructure |
6 | Pools, hosts, images, FSLogix, directories, env vars |
How It Works¶
Pre-built reports automatically:
- Fetch all required data from multiple API endpoints
- Resolve context for nested resources (hosts from each pool, details for each device)
- Flatten nested arrays for readable tables (e.g., compliance states become "2 Compliant, 1 Error")
- Apply templates for consistent column formatting
# Generate all 4 report types for an account
@('AccountOverview', 'DeviceInventory', 'SecurityCompliance', 'Infrastructure') | ForEach-Object {
Invoke-NMMReport -ReportType $_ -AccountId 67 -OutputPath "./reports/$_.html"
}
For more details, see Invoke-NMMReport.
Related Cmdlets¶
| Cmdlet | Description |
|---|---|
| Invoke-NMMReport | Generate pre-built reports |
| ConvertTo-NMMHtmlReport | Simple pipeline to HTML |
| New-NMMReport | Initialize report builder |
| Add-NMMReportSection | Add section to report |
| Export-NMMReport | Generate HTML output |
| Add-NMMTypeName | Tag data with PSTypeName |