New-AsBuiltConfig
Description
New-AsBuiltConfig starts a menu-driven procedure in the PowerShell console asking the user a series of questions to create a JSON configuration file. The JSON configuration file may be saved and referenced by the AsBuiltConfigFilePath parameter in New-AsBuiltReport.
New-AsBuiltConfig is automatically called by New-AsBuiltReport if the AsBuiltConfigFilePath parameter is not specified. If a user wishes to generate a new AsBuiltReport configuration without generating a new report, this command can be called as a standalone cmdlet.
When to Use This Command
| Scenario | Recommended Approach |
|---|---|
| First Time User | Let New-AsBuiltReport prompt you automatically |
| Multiple Clients/Sites | Run New-AsBuiltConfig to create separate configs for each |
| Corporate Branding | Create a config once, reuse for all reports |
| Email Distribution | Configure SMTP settings once, use across all reports |
| Quick Test | Skip this - just run New-AsBuiltReport and answer prompts |
Configuration Reuse
Create configuration files for different scenarios:
- Client-specific:
ACME-Config.json,WayneCorp-Config.json - Environment-specific:
Production-Config.json,Development-Config.json - Purpose-specific:
Audit-Config.json,Documentation-Config.json
Then reference them with: -AsBuiltConfigFilePath 'C:\Configs\ACME-Config.json'
Parameters
There are no additional parameters for this command.
Examples
-
Starts a menu-driven procedure to create an AsBuiltReport configuration file.
New-AsBuiltConfig Sample Output
AsBuiltReport Information
Enter the name of the Author for this AsBuiltReport [Tim]:
Tim CarmanCompany Information
Would you like to enter Company information for the AsBuiltReport? (y/N):
yEnter the Full Company Name:
Wayne EnterprisesEnter the Company Short Name:
WayneCorpEnter the Company Contact:
Bruce WayneEnter the Company Email Address:
[email protected]Enter the Company Phone:
555-555-5555Enter the Company Address:
Wayne Tower, Gotham CityEmail Configuration
Would you like to enter SMTP configuration? (y/N):
yEnter the mail server FQDN / IP address:
172.16.10.30Enter the mail server port number [25]:
25Use SSL for mail server connection? (true/false):
trueRequire mail server authentication? (true/false):
falseEnter the mail sender address:
[email protected]Enter the mail server recipient address:
[email protected]Do you want to enter another recipient? (y/N):
nEnter the email message body content:
AsBuiltReport attachedAsBuiltReport Configuration
Would you like to save the AsBuiltReport configuration file? (Y/n):
yEnter a name for the AsBuiltReport configuration file [AsBuiltReport]:
WayneCorpEnter the path to save the AsBuiltReport configuration file [C:\Users\Tim\AsBuiltReport]:
C:\Documents\Clients\WayneCorp\AsBuiltReportName Value Email {Port, Server, Body, UseSSL…} UserFolder {Path} Company {ShortName, Phone, Contact, Email…} Report {Author} New-AsBuiltConfig Sample JSON Configuration{ "Email": { "Port": "25", "Server": "172.16.10.30", "Body": "AsBuiltReport attached", "UseSSL": true, "To": [ "[email protected]" ], "Credentials": false, "From": "[email protected]" }, "UserFolder": { "Path": "C:\\Documents\\Clients\\ACME\\AsBuiltReport" }, "Company": { "ShortName": "WayneCorp", "Phone": "555-555-5555", "Contact": "Bruce Wayne", "Email": "[email protected]", "Address": "Wayne Tower, Gotham City", "FullName": "Wayne Enterprises" }, "Report": { "Author": "Tim Carman" } }
SMTP Credentials Security
If your SMTP server requires authentication ("Credentials": true), you will be prompted for credentials when running New-AsBuiltReport. These credentials are not stored in the configuration file. For automated/scheduled reports, consider:
- Using an SMTP server that doesn't require authentication (internal relay)
- Configuring SMTP to allow sending from your server without authentication
- Using application-specific passwords or service accounts
Using Configuration Files
Once created, reference your configuration file when generating reports:
New-AsBuiltReport -Report VMware.vSphere -Target vcenter.example.com `
-Credential $Cred -AsBuiltConfigFilePath 'C:\Configs\WayneCorp.json' `
-OutputFolderPath 'C:\Reports'
You can create and maintain multiple configuration files for different purposes:
# Client A - Full branding and email
New-AsBuiltReport -Report VMware.vSphere -Target vcenter-clienta.com `
-Credential $Cred -AsBuiltConfigFilePath 'C:\Configs\ClientA.json'
# Client B - Different branding and email
New-AsBuiltReport -Report VMware.vSphere -Target vcenter-clientb.com `
-Credential $Cred -AsBuiltConfigFilePath 'C:\Configs\ClientB.json'
See Also
- New-AsBuiltReport - Generate as-built configuration reports
- New-AsBuiltReportConfig - Create report-specific configuration files
- FAQ - How do I schedule reports? - Automating report generation