Export-SPCReport¶
Generates a report from orphaned user pipeline input in CSV, HTML, or JSON format.
License requirement
HTML format requires a Pro or Consultant license. CSV and JSON are available on the Free tier.
Synopsis¶
Export-SPCReport
-InputObject <SPC.OrphanedUser[]>
[-Format CSV | HTML | JSON]
[-OutputPath <string>]
[-GroupBy Site | RiskLevel | OrphanType]
[-IncludeSummary]
[-BrandingName <string>]
[-PassThru]
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
-InputObject |
SPC.OrphanedUser[] |
✅ | Accepts pipeline input |
-Format |
CSV \| HTML \| JSON |
Output format. Default: CSV |
|
-OutputPath |
string |
Full path for the output file. Default: auto-named file in the current directory | |
-GroupBy |
Site \| RiskLevel \| OrphanType |
Sort/group rows by field. Default: Site |
|
-IncludeSummary |
switch | Prepend a summary card with totals and breakdown by risk level | |
-BrandingName |
string |
Override 'SPClean' with a custom brand name on HTML reports. Requires Consultant license. | |
-PassThru |
switch | Pass input SPC.OrphanedUser objects through the pipeline after writing the report |
Returns¶
SPC.ReportResult with properties:
| Property | Description |
|---|---|
FilePath |
Absolute path to the generated file |
Format |
The format used (CSV, HTML, or JSON) |
TotalOrphansReported |
Count of records written |
GeneratedAt |
UTC timestamp |
Format notes¶
CSV¶
- UTF-8 with BOM (Excel-compatible)
- 11 columns covering all
SPC.OrphanedUserproperties - Sorted by the
-GroupByfield
HTML¶
- Self-contained — all CSS and JavaScript are inlined; no external dependencies
- Colour-coded risk badges: HIGH (red), MEDIUM (amber), LOW (green)
- Sortable columns via click
- Optional summary card with totals and breakdown chart when
-IncludeSummaryis used
JSON¶
- Root object grouped by the
-GroupByfield - Optional
summaryblock when-IncludeSummaryis used
Notes¶
- HTML format is gated —
Export-SPCReport -Format HTMLrequires a Pro or Consultant license. Calling it on the Free tier raisesERR-LIC-003. - CSV format is always available with no license requirement.
- The output file path is returned in
SPC.ReportResult.FilePathregardless of whether-OutputPathwas specified, so you can pipe or capture it for further processing.