Skip to content

Commit 95cb1b9

Browse files
authored
Merge pull request #195 from rebelinux/dev
v0.9.2
2 parents 76db86e + 6002962 commit 95cb1b9

35 files changed

+708
-400
lines changed

.github/workflows/PSScriptAnalyzerSettings.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@{
22
ExcludeRules = @(
3-
'PSUseBOMForUnicodeEncodedFile',
43
'PSUseToExportFieldsInManifest'
54
)
65
Rules = @{

.github/workflows/dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

AsBuiltReport.Microsoft.AD.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
},
1818
"Include": {
1919
"Domains": []
20-
}
20+
},
21+
"WinRMSSL": false,
22+
"WinRMFallbackToNoSSL": true,
23+
"WinRMSSLPort": 5986,
24+
"WinRMPort": 5985
2125
},
2226
"InfoLevel": {
2327
"_comment_": "0 = Disabled, 1 = Enabled, 2 = Adv Summary, 3 = Detailed",

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Added
1313

14-
- Improve DC selection logic
14+
- Add support for WinRM over SSL
15+
- Add option to set the WinRM tcp port used for PSSession connection setup
1516

1617
### Changed
1718

1819
- Increase Diagrammer.Core minimum requirement
1920
- Increase AsBuiltReport.Core to v1.4.1
21+
- Improve DC selection logic
22+
- Improve HealthCheck best practice recommendations (Copilot)
2023

2124
### Fixed
2225

2326
- Fix [#190](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/190)
2427
- Fix [#191](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/191)
2528
- Fix ConvertTo-HashToYN cmdlet not generating an ordereddictionary output
2629

30+
### Removed
31+
32+
- Remove dependabot action (Not supported in Abr Organization)
33+
2734
## [0.9.1] - 2024-11-15
2835

2936
### Added

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,17 @@ The **Options** schema allows certain options within the report to be toggled on
174174

175175
| Sub-Schema | Setting | Default | Description |
176176
| ----------------------- | ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------- |
177-
| ShowDefinitionInfo | true/false | false | Toggle to enable/disable Microsoft AD term explanations |
177+
| ShowDefinitionInfo | true/false | False | Toggle to enable/disable Microsoft AD term explanations |
178178
| PSDefaultAuthentication | Negotiate/Kerberos | Negotiate | Allow to set the value of the PSRemoting authentication method. For Workgroup authentication Negotiate value is required. |
179179
| Exclude.Domains | Array List | Empty | Allow to filter on AD Domain FQDN |
180180
| Exclude.DCs | Array List | Empty | Allow to filter on AD Domain Controller Server FQDN. |
181181
| Include.Domains | Array List | Empty | Allow only a list of Active Directory Domain Controller FQDN to document. |
182182
| Include.DCs | Array List | Empty | Allow only a list of Active Directory Domain FQDN to document. |
183+
| WinRMSSL | Bool | True | Allow to enable SSL for WINRM connection |
184+
| WinRMFallbackToNoSSL | Bool | True | Allow to fallback to WINRM without SSL |
185+
| WinRMSSLPort | Int | 5986 | Allow to set tcp port for WinRM over SSL |
186+
| WinRMPort | Int | 5985 | Allow to set tcp port for WinRM |
187+
183188

184189
### InfoLevel
185190

Src/Private/Get-AbrADCAAIA.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrADCAAIA {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.9.1
8+
Version: 0.9.2
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -23,13 +23,13 @@ function Get-AbrADCAAIA {
2323
)
2424

2525
begin {
26-
Write-PScriboMessage "Collecting AD Certification Authority Authority Information Access information."
26+
Write-PScriboMessage "Collecting Active Directory Certification Authority Information Access details."
2727
}
2828

2929
process {
3030
if ($CA) {
3131
Section -Style Heading3 "Authority Information Access (AIA)" {
32-
Paragraph "The following section provides the Certification Authority Authority Information Access information."
32+
Paragraph "The following section provides the Certification Authority Information Access details."
3333
BlankLine
3434
try {
3535
$OutObj = @()

Src/Private/Get-AbrADDCDiag.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Get-AbrADDCDiag {
3030
}
3131

3232
process {
33-
if (Test-WSMan -Credential $Credential -Authentication $Options.PSDefaultAuthentication -ComputerName $DC -ErrorAction SilentlyContinue) {
33+
if (Get-DCWinRMState -ComputerName $DC) {
3434
try {
3535
$DCDIAG = Invoke-DcDiag -DomainController $DC
3636
if ($DCDIAG) {
@@ -87,7 +87,7 @@ function Get-AbrADDCDiag {
8787
$OutObj | Sort-Object -Property 'Entity' | Table @TableParams
8888
}
8989
} else {
90-
Write-PScriboMessage -IsWarning "No DCDiag information found in $DC, disabling the section."
90+
Write-PScriboMessage "No DCDiag information found in $DC, Disabling this section."
9191
}
9292
} catch {
9393
Write-PScriboMessage -IsWarning "Active Directory DCDiag Section: $($_.Exception.Message)"

Src/Private/Get-AbrADDCRoleFeature.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrADDCRoleFeature {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.9.1
8+
Version: 0.9.2
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -29,15 +29,15 @@ function Get-AbrADDCRoleFeature {
2929

3030
process {
3131
try {
32-
$DCPssSession = try { New-PSSession -ComputerName $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'ADDCRoleFeature' -ErrorAction Stop } catch {
33-
if (-Not $_.Exception.MessageId) {
34-
$ErrorMessage = $_.FullyQualifiedErrorId
35-
} else {$ErrorMessage = $_.Exception.MessageId}
36-
Write-PScriboMessage -IsWarning "Roles Section: New-PSSession: Unable to connect to $($DC): $ErrorMessage"
37-
}
32+
$DCPssSession = Get-ValidPSSession -ComputerName $DC -SessionName 'ADDCRoleFeature'
3833
if ($DCPssSession) {
3934
$Features = Invoke-Command -Session $DCPssSession -ScriptBlock { Get-WindowsFeature | Where-Object { $_.installed -eq "True" -and $_.FeatureType -eq 'Role' } }
4035
Remove-PSSession -Session $DCPssSession
36+
} else {
37+
if (-Not $_.Exception.MessageId) {
38+
$ErrorMessage = $_.FullyQualifiedErrorId
39+
} else { $ErrorMessage = $_.Exception.MessageId }
40+
Write-PScriboMessage -IsWarning "Roles Section: New-PSSession: Unable to connect to $($DC): $ErrorMessage"
4141
}
4242
if ($Features) {
4343
Section -ExcludeFromTOC -Style NOTOCHeading5 $($DC.ToString().ToUpper().Split(".")[0]) {
@@ -82,7 +82,5 @@ function Get-AbrADDCRoleFeature {
8282
Write-PScriboMessage -IsWarning "Roles Section: $($_.Exception.Message)"
8383
}
8484
}
85-
8685
end {}
87-
8886
}

Src/Private/Get-AbrADDFSHealth.ps1

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,28 @@ function Get-AbrADDFSHealth {
9797
}
9898
}
9999
} else {
100-
Write-PScriboMessage -IsWarning "No DFS information found in $Domain, disabling the section."
100+
Write-PScriboMessage "No DFS information found in $Domain, Disabling this section."
101101
}
102102
} catch {
103103
Write-PScriboMessage -IsWarning "Sysvol Replication Status Table Section: $($_.Exception.Message)"
104104
}
105105
try {
106106
$DC = Get-ValidDCfromDomain -Domain $Domain
107107

108-
$DCPssSession = try { New-PSSession -ComputerName $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'DomainSysvolHealth' -ErrorAction Stop } catch {
109-
if (-Not $_.Exception.MessageId) {
110-
$ErrorMessage = $_.FullyQualifiedErrorId
111-
} else { $ErrorMessage = $_.Exception.MessageId }
112-
Write-PScriboMessage -IsWarning "Sysvol Content Status Section: New-PSSession: Unable to connect to $($DC): $ErrorMessage"
113-
}
114-
# Code taken from ClaudioMerola (https://github.com/ClaudioMerola/ADxRay)
108+
$DCPssSession = Get-ValidPSSession -ComputerName $DC -SessionName 'DomainSysvolHealth'
115109
if ($DCPssSession) {
110+
# Code taken from ClaudioMerola (https://github.com/ClaudioMerola/ADxRay)
116111
$SYSVOLFolder = Invoke-Command -Session $DCPssSession { Get-ChildItem -Path $('\\' + $using:Domain + '\SYSVOL\' + $using:Domain) -Recurse | Where-Object -FilterScript { $_.PSIsContainer -eq $false } | Group-Object -Property Extension | ForEach-Object -Process {
117112
New-Object -TypeName PSObject -Property @{
118113
'Extension' = $_.name
119114
'Count' = $_.count
120115
'TotalSize' = '{0:N2}' -f ((($_.group | Measure-Object length -Sum).Sum) / 1MB)
121116
} } | Sort-Object -Descending -Property 'Totalsize' }
117+
} else {
118+
if (-Not $_.Exception.MessageId) {
119+
$ErrorMessage = $_.FullyQualifiedErrorId
120+
} else { $ErrorMessage = $_.Exception.MessageId }
121+
Write-PScriboMessage -IsWarning "Sysvol Content Status Section: New-PSSession: Unable to connect to $($DC): $ErrorMessage"
122122
}
123123
if ($SYSVOLFolder) {
124124
Section -ExcludeFromTOC -Style NOTOCHeading4 'Sysvol Content Status' {
@@ -157,12 +157,12 @@ function Get-AbrADDFSHealth {
157157
BlankLine
158158
Paragraph {
159159
Text "Corrective Actions:" -Bold
160-
Text "Make sure Sysvol folder has no malicious extensions or unnecessary content."
160+
Text "Review the files and extensions listed above and ensure they are necessary for the operation of your domain. Remove any files that are not required or that appear suspicious. Regularly monitor the Sysvol folder to maintain a healthy and secure Active Directory environment."
161161
}
162162
}
163163
}
164164
} else {
165-
Write-PScriboMessage -IsWarning "No SYSVOL folder information found in $Domain, disabling the section."
165+
Write-PScriboMessage "No SYSVOL folder information found in $Domain, Disabling this section."
166166
}
167167
if ($DCPssSession) {
168168
Remove-PSSession -Session $DCPssSession
@@ -172,20 +172,20 @@ function Get-AbrADDFSHealth {
172172
}
173173
try {
174174
$DC = Get-ValidDCfromDomain -Domain $Domain
175-
$DCPssSession = try { New-PSSession -ComputerName $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'NetlogonHealth' -ErrorAction Stop } catch {
176-
if (-Not $_.Exception.MessageId) {
177-
$ErrorMessage = $_.FullyQualifiedErrorId
178-
} else { $ErrorMessage = $_.Exception.MessageId }
179-
Write-PScriboMessage -IsWarning "Netlogon Content Status Section: New-PSSession: Unable to connect to $($DC): $ErrorMessage"
180-
}
181-
# Code taken from ClaudioMerola (https://github.com/ClaudioMerola/ADxRay)
175+
$DCPssSession = Get-ValidPSSession -ComputerName $DC -SessionName 'NetlogonHealth'
182176
if ($DCPssSession) {
177+
# Code taken from ClaudioMerola (https://github.com/ClaudioMerola/ADxRay)
183178
$NetlogonFolder = Invoke-Command -Session $DCPssSession { Get-ChildItem -Path $('\\' + $using:Domain + '\NETLOGON\') -Recurse | Where-Object -FilterScript { $_.PSIsContainer -eq $false } | Group-Object -Property Extension | ForEach-Object -Process {
184179
New-Object -TypeName PSObject -Property @{
185180
'Extension' = $_.name
186181
'Count' = $_.count
187182
'TotalSize' = '{0:N2}' -f ((($_.group | Measure-Object length -Sum).Sum) / 1MB)
188183
} } | Sort-Object -Descending -Property 'Totalsize' }
184+
} else {
185+
if (-Not $_.Exception.MessageId) {
186+
$ErrorMessage = $_.FullyQualifiedErrorId
187+
} else { $ErrorMessage = $_.Exception.MessageId }
188+
Write-PScriboMessage -IsWarning "Netlogon Content Status Section: New-PSSession: Unable to connect to $($DC): $ErrorMessage"
189189
}
190190
if ($NetlogonFolder) {
191191
Section -ExcludeFromTOC -Style NOTOCHeading4 'Netlogon Content Status' {
@@ -224,12 +224,12 @@ function Get-AbrADDFSHealth {
224224
BlankLine
225225
Paragraph {
226226
Text "Corrective Actions:" -Bold
227-
Text "Make sure Netlogon folder has no malicious extensions or unnecessary content."
227+
Text "Review the files and extensions listed above and ensure they are necessary for the operation of your domain. Remove any files that are not required or that appear suspicious. Regularly monitor the Netlogon folder to maintain a healthy and secure Active Directory environment."
228228
}
229229
}
230230
}
231231
} else {
232-
Write-PScriboMessage -IsWarning "No NETLOGON folder information found in $Domain, disabling the section."
232+
Write-PScriboMessage "No NETLOGON folder information found in $Domain, Disabling this section."
233233
}
234234
if ($DCPssSession) {
235235
Remove-PSSession -Session $DCPssSession

0 commit comments

Comments
 (0)