Skip to content

Commit

Permalink
Merge pull request #179 from rebelinux/dev
Browse files Browse the repository at this point in the history
v0.8.2 improvements and fix issues
  • Loading branch information
rebelinux committed Jun 13, 2024
2 parents da94bdc + 76ac38a commit 7cbdbeb
Show file tree
Hide file tree
Showing 17 changed files with 668 additions and 388 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.8.1] - 2024-05-16

### Changed

- Improved code to better handle errors

### Fixed

- [#168](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/168)
- [#171](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/171)
- [#172](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/172)
- [#174](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/174)
- [#176](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/176)
- [#178](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/178)

## [0.8.1] - 2024-05-16

### Added

- Site Topology diagram
Expand Down
3 changes: 2 additions & 1 deletion Src/Private/Get-AbrADDCRoleFeature.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function Get-AbrADDCRoleFeature {

process {
try {
if ($DCPssSession = New-PSSession $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'ADDCRoleFeature') {
$DCPssSession = New-PSSession $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'ADDCRoleFeature'
if ($DCPssSession) {
$Features = Invoke-Command -Session $DCPssSession -ScriptBlock { Get-WindowsFeature | Where-Object { $_.installed -eq "True" -and $_.FeatureType -eq 'Role' } }
Remove-PSSession -Session $DCPssSession
}
Expand Down
32 changes: 18 additions & 14 deletions Src/Private/Get-AbrADDFSHealth.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrADDFSHealth {
.DESCRIPTION
.NOTES
Version: 0.8.1
Version: 0.8.2
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -106,12 +106,14 @@ function Get-AbrADDFSHealth {
$DC = Invoke-Command -Session $TempPssSession { (Get-ADDomain -Identity $using:Domain).ReplicaDirectoryServers | Select-Object -First 1 }
$DCPssSession = New-PSSession $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'DomainSysvolHealth'
# Code taken from ClaudioMerola (https://github.com/ClaudioMerola/ADxRay)
$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 {
New-Object -TypeName PSObject -Property @{
'Extension' = $_.name
'Count' = $_.count
'TotalSize' = '{0:N2}' -f ((($_.group | Measure-Object length -Sum).Sum) / 1MB)
} } | Sort-Object -Descending -Property 'Totalsize' }
if ($DCPssSession) {
$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 {
New-Object -TypeName PSObject -Property @{
'Extension' = $_.name
'Count' = $_.count
'TotalSize' = '{0:N2}' -f ((($_.group | Measure-Object length -Sum).Sum) / 1MB)
} } | Sort-Object -Descending -Property 'Totalsize' }
}
if ($SYSVOLFolder) {
Section -ExcludeFromTOC -Style NOTOCHeading4 'Sysvol Content Status' {
Paragraph "The following section details domain $($Domain.ToString().ToUpper()) sysvol health status."
Expand Down Expand Up @@ -166,12 +168,14 @@ function Get-AbrADDFSHealth {
$DC = Invoke-Command -Session $TempPssSession { (Get-ADDomain -Identity $using:Domain).ReplicaDirectoryServers | Select-Object -First 1 }
$DCPssSession = New-PSSession $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'NetlogonHealth'
# Code taken from ClaudioMerola (https://github.com/ClaudioMerola/ADxRay)
$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 {
New-Object -TypeName PSObject -Property @{
'Extension' = $_.name
'Count' = $_.count
'TotalSize' = '{0:N2}' -f ((($_.group | Measure-Object length -Sum).Sum) / 1MB)
} } | Sort-Object -Descending -Property 'Totalsize' }
if ($DCPssSession) {
$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 {
New-Object -TypeName PSObject -Property @{
'Extension' = $_.name
'Count' = $_.count
'TotalSize' = '{0:N2}' -f ((($_.group | Measure-Object length -Sum).Sum) / 1MB)
} } | Sort-Object -Descending -Property 'Totalsize' }
}
if ($NetlogonFolder) {
Section -ExcludeFromTOC -Style NOTOCHeading4 'Netlogon Content Status' {
Paragraph "The following section details domain $($Domain.ToString().ToUpper()) netlogon health status."
Expand Down Expand Up @@ -220,7 +224,7 @@ function Get-AbrADDFSHealth {
Remove-PSSession -Session $DCPssSession
}
} catch {
Write-PScriboMessage -IsWarning "Sysvol Health Section: $($_.Exception.Message)"
Write-PScriboMessage -IsWarning "Netlogon Content Status Section: $($_.Exception.Message)"
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions Src/Private/Get-AbrADDNSZone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrADDNSZone {
.DESCRIPTION
.NOTES
Version: 0.8.1
Version: 0.8.2
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -31,6 +31,7 @@ function Get-AbrADDNSZone {

process {
try {
$DCPssSession = New-PSSession $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'DDNSInfrastructure'
$DNSSetting = Get-DnsServerZone -CimSession $TempCIMSession -ComputerName $DC | Where-Object { $_.IsReverseLookupZone -like "False" -and $_.ZoneType -notlike "Forwarder" }
if ($DNSSetting) {
Section -Style Heading3 "$($DC.ToString().ToUpper().Split(".")[0]) DNS Zones" {
Expand Down Expand Up @@ -115,7 +116,11 @@ function Get-AbrADDNSZone {

if ($InfoLevel.DNS -ge 2) {
try {
$DNSSetting = Invoke-Command -Session $DCPssSession { Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones\*" | Get-ItemProperty | Where-Object { $_ -match 'SecondaryServers' } }
$DNSSetting = $Null
if ($DCPssSession) {
$DNSSetting = Invoke-Command -Session $DCPssSession { Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones\*" | Get-ItemProperty | Where-Object { $_ -match 'SecondaryServers' } }
Remove-PSSession -Session $DCPssSession
}
if ($DNSSetting) {
Section -Style Heading4 "Zone Transfers" {
$OutObj = @()
Expand Down Expand Up @@ -298,7 +303,6 @@ function Get-AbrADDNSZone {
}
}
}
Remove-PSSession -Session $DCPssSession
} catch {
Write-PScriboMessage -IsWarning "$($_.Exception.Message) (Global DNS Zone Information)"
}
Expand Down
Loading

0 comments on commit 7cbdbeb

Please sign in to comment.