Skip to content

Commit 85cdf31

Browse files
tpcarmanrebelinux
andauthored
v0.2.0 release (#2)
* Repository setup * Update LICENSE * Fix Release GitHub workflow * v0.2.0 release (#1) * Added per section InfoLevel and DC Diagnostic HealthCheck * Added a function to convert bytes automatically to GB or TB based on size * Added a function to convert true or false automatically to Yes or No. Hate Switch cases * Added initial report structure * Convert true or false output to yes or no * Add Active Directory version support, Module Requirements and examples * Fix forwrong false case * Fix string output * Update function name * Add function with new name * Update the functions to filter the content by Domain * Update switch case * Add Organization Unit reporting * Pscribo Message fix * Add site replication health check * Fix created time format * Add site links to the site report function * Add site replication function * Update funtion to better handle DC unavailable situations * Add Site replication to the main report also fix InfoLevel * Section Style Rename * Add code to better handle unavailable DC Server * Add Domain Controller Time Source Function also fix misc issues * Added funtion to check AD Services status (DNS,NTP, NTDS etc) * Add code to beter catch AD Domain issues * Add support to Microsoft Active Directory Group Policy Objects information * Update section heading text * Add support to Microsoft AD Domain Name System Infrastructure information * Add GPO support in Domain Section also added new DNS Section * Add more healthcheck support * update version to 0.2.0 * Add support for DNS Zone information * Ensure support for PSv5.1+ * Update changelog with initial release features * Updated Readme Module Requirements and installation examples * Updated required permissions * Update functions to use pssession * Added more try\catch conditions also improve verbose/debug logging * implement a shared function util file * Added misc documentation * Updated changelog for 0.2.0 changes * Fix FQDN text * Add more Examples * Fix misc text * More fixes * Added Known Issues * Added sample report * The never ending fixes (Readme) * Readme Fixes :( * Readme example fixes * requested recomendation Co-authored-by: Jonathan Colon <rebelinux@gmail.com>
1 parent 3a0a694 commit 85cdf31

29 files changed

+3353
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Screenshots**
21+
If applicable, add screenshots to help explain your problem.
22+
23+
**Desktop (please complete the following information):**
24+
- OS: [e.g. iOS]
25+
- Browser [e.g. chrome, safari]
26+
- Version [e.g. 22]
27+
28+
**Smartphone (please complete the following information):**
29+
- Device: [e.g. iPhone6]
30+
- OS: [e.g. iOS8.1]
31+
- Browser [e.g. stock browser, safari]
32+
- Version [e.g. 22]
33+
34+
**Additional context**
35+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Related Issue
7+
<!--- This project only accepts pull requests related to open issues -->
8+
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
9+
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
10+
<!--- Please link to the issue here: -->
11+
12+
## Motivation and Context
13+
<!--- Why is this change required? What problem does it solve? -->
14+
15+
## How Has This Been Tested?
16+
<!--- Please describe in detail how you tested your changes. -->
17+
<!--- Include details of your testing environment, and the tests you ran to -->
18+
<!--- see how your change affects other areas of the code, etc. -->
19+
20+
## Screenshots (if appropriate):
21+
22+
## Types of changes
23+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
24+
- [ ] Bug fix (non-breaking change which fixes an issue)
25+
- [ ] New feature (non-breaking change which adds functionality)
26+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
27+
28+
## Checklist:
29+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
30+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
31+
- [ ] My code follows the code style of this project.
32+
- [ ] My change requires a change to the documentation.
33+
- [ ] I have updated the documentation accordingly.
34+
- [ ] I have read the [**CONTRIBUTING**](/CONTRIBUTING.md) document.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: PSScriptAnalyzer
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
name: Run PSScriptAnalyzer
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: lint
10+
uses: devblackops/github-action-psscriptanalyzer@master
11+
with:
12+
sendComment: true
13+
failOnErrors: true
14+
failOnWarnings: false
15+
failOnInfos: false
16+
repoToken: ${{ secrets.GITHUB_TOKEN }}
17+
settingsPath: .github/workflows/PSScriptAnalyzerSettings.psd1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@{
2+
ExcludeRules = @(
3+
'PSUseToExportFieldsInManifest',
4+
'PSReviewUnusedParameter',
5+
'PSUseDeclaredVarsMoreThanAssignments',
6+
'PSAvoidGlobalVars'
7+
)
8+
}

.github/workflows/Release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish PowerShell Module
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-to-gallery:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set PSRepository to Trusted for PowerShell Gallery
13+
shell: pwsh
14+
run: |
15+
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
16+
- name: Install AsBuiltReport.Core module
17+
shell: pwsh
18+
run: |
19+
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
20+
- name: Publish module to PowerShell Gallery
21+
shell: pwsh
22+
run: |
23+
Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"powershell.codeFormatting.preset": "Custom",
3+
"powershell.codeFormatting.useCorrectCasing": true,
4+
"powershell.codeFormatting.autoCorrectAliases": true,
5+
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
6+
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
7+
"powershell.codeFormatting.whitespaceAroundOperator": true,
8+
"powershell.codeFormatting.whitespaceAfterSeparator": true,
9+
"powershell.codeFormatting.addWhitespaceAroundPipe": true,
10+
"powershell.codeFormatting.ignoreOneLineBlock": true,
11+
"powershell.codeFormatting.newLineAfterCloseBrace": false,
12+
"powershell.codeFormatting.newLineAfterOpenBrace": true,
13+
"powershell.codeFormatting.openBraceOnSameLine": true,
14+
"powershell.codeFormatting.alignPropertyValuePairs": false,
15+
"powershell.codeFolding.enable": true,
16+
"powershell.scriptAnalysis.enable": true,
17+
"powershell.scriptAnalysis.settingsPath": ".github/workflows/PSScriptAnalyzerSettings.psd1",
18+
"editor.tabSize": 4,
19+
"editor.insertSpaces": true,
20+
"editor.detectIndentation": false,
21+
"editor.rulers": [
22+
115
23+
],
24+
"files.trimTrailingWhitespace": true
25+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Microsoft AD Default Document Style
2+
3+
# Configure document options
4+
DocumentOption -EnableSectionNumbering -PageSize A4 -DefaultFont 'Arial' -MarginLeftAndRight 71 -MarginTopAndBottom 71 -Orientation $Orientation
5+
6+
# Configure Heading and Font Styles
7+
Style -Name 'Title' -Size 24 -Color '737373' -Align Center
8+
Style -Name 'Title 2' -Size 18 -Color '00A4EF' -Align Center
9+
Style -Name 'Title 3' -Size 12 -Color '00A4EF' -Align Left
10+
Style -Name 'Heading 1' -Size 16 -Color '00A4EF'
11+
Style -Name 'Heading 2' -Size 14 -Color '00A4EF'
12+
Style -Name 'Heading 3' -Size 12 -Color '00A4EF'
13+
Style -Name 'Heading 4' -Size 11 -Color '00A4EF'
14+
Style -Name 'Heading 5' -Size 10 -Color '00A4EF'
15+
Style -Name 'Normal' -Size 10 -Color '565656' -Default
16+
Style -Name 'Caption' -Size 10 -Color '565656' -Italic -Align Center
17+
Style -Name 'Header' -Size 10 -Color '565656' -Align Center
18+
Style -Name 'Footer' -Size 10 -Color '565656' -Align Center
19+
Style -Name 'TOC' -Size 16 -Color '00A4EF'
20+
Style -Name 'TableDefaultHeading' -Size 10 -Color 'FAFAFA' -BackgroundColor '00A4EF'
21+
Style -Name 'TableDefaultRow' -Size 10 -Color '565656'
22+
Style -Name 'Critical' -Size 10 -BackgroundColor 'F25022'
23+
Style -Name 'Warning' -Size 10 -BackgroundColor 'FFB900'
24+
Style -Name 'Info' -Size 10 -BackgroundColor '00A4EF'
25+
Style -Name 'OK' -Size 10 -BackgroundColor '7FBA00'
26+
27+
# Configure Table Styles
28+
$TableDefaultProperties = @{
29+
Id = 'TableDefault'
30+
HeaderStyle = 'TableDefaultHeading'
31+
RowStyle = 'TableDefaultRow'
32+
BorderColor = '00A4EF'
33+
Align = 'Left'
34+
CaptionStyle = 'Caption'
35+
CaptionLocation = 'Below'
36+
BorderWidth = 0.25
37+
PaddingTop = 1
38+
PaddingBottom = 1.5
39+
PaddingLeft = 2
40+
PaddingRight = 2
41+
}
42+
43+
TableStyle @TableDefaultProperties -Default
44+
TableStyle -Id 'Borderless' -HeaderStyle Normal -RowStyle Normal -BorderWidth 0
45+
46+
# Microsoft AD Cover Page Layout
47+
# Header & Footer
48+
if ($ReportConfig.Report.ShowHeaderFooter) {
49+
Header -Default {
50+
Paragraph -Style Header "$($ReportConfig.Report.Name) - v$($ReportConfig.Report.Version)"
51+
}
52+
53+
Footer -Default {
54+
Paragraph -Style Footer 'Page <!# PageNumber #!>'
55+
}
56+
}
57+
58+
# Set position of report titles and information based on page orientation
59+
if (!($ReportConfig.Report.ShowCoverPageImage)) {
60+
$LineCount = 5
61+
}
62+
if ($Orientation -eq 'Portrait') {
63+
BlankLine -Count 11
64+
$LineCount = 32 + $LineCount
65+
} else {
66+
BlankLine -Count 7
67+
$LineCount = 15 + $LineCount
68+
}
69+
70+
# Microsoft Logo Image
71+
if ($ReportConfig.Report.ShowCoverPageImage) {
72+
# Always check the vendor's branding guidelines to ensure the use of their company logo is allowed.
73+
# Convert a vendor's logo image to Base64 using https://base64.guru/converter/encode/image/jpg.
74+
# Specify Base64 code using the `Base64` parameter below. Size image accordingly using the `Percent` parameter. Align image to center.
75+
<#
76+
Try {
77+
# Image -Text 'Microsoft Logo' -Align 'Center' -Percent 5 -Base64 ""
78+
} Catch {
79+
Write-PScriboMessage -Message ".NET Core is required for cover page image support. Please install .NET Core or disable 'ShowCoverPageImage' in the report JSON configuration file."
80+
}
81+
#>
82+
}
83+
84+
# Add Report Name
85+
Paragraph -Style Title $ReportConfig.Report.Name
86+
87+
if ($AsBuiltConfig.Company.FullName) {
88+
# Add Company Name if specified
89+
BlankLine -Count 2
90+
Paragraph -Style Title2 $AsBuiltConfig.Company.FullName
91+
BlankLine -Count $LineCount
92+
} else {
93+
BlankLine -Count ($LineCount + 1)
94+
}
95+
Table -Name 'Cover Page' -List -Style Borderless -Width 0 -Hashtable ([Ordered] @{
96+
'Author:' = $AsBuiltConfig.Report.Author
97+
'Date:' = (Get-Date).ToLongDateString()
98+
'Version:' = $ReportConfig.Report.Version
99+
})
100+
PageBreak
101+
102+
if ($ReportConfig.Report.ShowTableOfContents) {
103+
# Add Table of Contents
104+
TOC -Name 'Table of Contents'
105+
PageBreak
106+
}

AsBuiltReport.Microsoft.AD.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"Report": {
3+
"Name": "Microsoft AD As Built Report",
4+
"Version": "1.0",
5+
"Status": "Released",
6+
"ShowCoverPageImage": true,
7+
"ShowTableOfContents": true,
8+
"ShowHeaderFooter": true,
9+
"ShowTableCaptions": true
10+
},
11+
"Options": {
12+
13+
},
14+
"InfoLevel": {
15+
"_comment_": "0 = Disabled, 1 = Enabled",
16+
"Forest": 1,
17+
"Domain": 1,
18+
"Site": 1,
19+
"DHCP": 1,
20+
"DNS": 1,
21+
"CA": 1
22+
},
23+
"HealthCheck": {
24+
"Domain": {
25+
"GMSA": true
26+
},
27+
"DomainController": {
28+
"Diagnostic": true,
29+
"Services": true
30+
},
31+
"Site": {
32+
"Replication": true
33+
},
34+
"DNS": {
35+
"Aging": true
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)