Skip to content

Commit

Permalink
Merge pull request #5 from rebelinux/dev
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
rebelinux authored Jan 29, 2022
2 parents cd6ed10 + 708f177 commit 0326835
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 118 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,43 @@ A Microsoft Windows As Built Report can be generated with Administrator level pr

## :package: Module Installation

The installation of the modules will depend on the roles that are being served on the server to be documented.

### PowerShell v5.x running on a Windows server (Target)
<!-- ********** Add installation for any additional PowerShell module(s) ********** -->

```powershell
Install-Module AsBuiltReport.Microsoft.Windows
# DNS/DHCP Server powershell modules
Install-WindowsFeature -Name RSAT-DNS-Server
Install-WindowsFeature -Name RSAT-DHCP
# Hyper-V Server powershell modules
Install-WindowsFeature -Name Hyper-V-PowerShell
#IIS Server powershell modules
Install-WindowsFeature -Name web-mgmt-console
Install-WindowsFeature -Name Web-Scripting-Tools
```

### PowerShell v5.x running on Windows 10 client computer (JumpBox)
<!-- ********** Add installation for any additional PowerShell module(s) ********** -->
```powershell
Install-Module AsBuiltReport.Microsoft.Windows
# DNS/DHCP Server powershell Modules
Add-WindowsCapability –online –Name 'Rsat.Dns.Tools~~~~0.0.1.0'
Add-WindowsCapability -Online -Name 'Rsat.DHCP.Tools~~~~0.0.1.0'
# Hyper-V Server powershell modules
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell
#IIS Server powershell modules
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementScriptingTools
```

### GitHub
Expand Down
4 changes: 2 additions & 2 deletions Src/Private/Get-AbrWinDHCPInfrastructure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function Get-AbrWinDHCPInfrastructure {
'Domain Joined' = ConvertTo-TextYN $Settings.IsDomainJoined
'Authorized' = ConvertTo-TextYN $Settings.IsAuthorized
'Conflict Detection Attempts' = $Settings.ConflictDetectionAttempts
'Activate Policies' = $Settings.ActivatePolicies
'Dynamic Bootp' = $Settings.DynamicBootp
'Activate Policies' = ConvertTo-TextYN $Settings.ActivatePolicies
'Dynamic Bootp' = ConvertTo-TextYN $Settings.DynamicBootp
'Database Path' = ConvertTo-EmptyToFiller $Database.FileName
'Database Backup Path' = ConvertTo-EmptyToFiller $Database.BackupPath
'Database Backup Interval' = switch ($Database.BackupInterval) {
Expand Down
27 changes: 16 additions & 11 deletions Src/Private/Get-AbrWinDHCPv4Scope.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@ function Get-AbrWinDHCPv4Scope {
BlankLine
$OutObj = @()
foreach ($Scope in $DHCPScopes) {
Write-PscriboMessage "Collecting DHCP Server $($Scope.ScopeId) Scope"
$SubnetMask = Convert-IpAddressToMaskLength $Scope.SubnetMask
$inObj = [ordered] @{
'Scope Id' = "$($Scope.ScopeId)/$($SubnetMask)"
'Scope Name' = $Scope.Name
'Scope Range' = "$($Scope.StartRange) - $($Scope.EndRange)"
'Lease Duration' = Switch ($Scope.LeaseDuration) {
"10675199.02:48:05.4775807" {"Unlimited"}
default {$Scope.LeaseDuration}
try {
Write-PscriboMessage "Collecting DHCP Server $($Scope.ScopeId) Scope"
$SubnetMask = Convert-IpAddressToMaskLength $Scope.SubnetMask
$inObj = [ordered] @{
'Scope Id' = "$($Scope.ScopeId)/$($SubnetMask)"
'Scope Name' = $Scope.Name
'Scope Range' = "$($Scope.StartRange) - $($Scope.EndRange)"
'Lease Duration' = Switch ($Scope.LeaseDuration) {
"10675199.02:48:05.4775807" {"Unlimited"}
default {$Scope.LeaseDuration}
}
'State' = $Scope.State
}
'State' = $Scope.State
$OutObj += [pscustomobject]$inobj
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
$OutObj += [pscustomobject]$inobj
}

$TableParams = @{
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrWinDNSZone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function Get-AbrWinDNSZone {
'Zone Type' = $Zones.ZoneType
'Replication Scope' = $Zones.ReplicationScope
'Master Servers' = $Zones.MasterServers
'DS Integrated' = $Zones.IsDsIntegrated
'DS Integrated' = ConvertTo-TextYN $Zones.IsDsIntegrated
}
$OutObj += [pscustomobject]$inobj
}
Expand Down
33 changes: 19 additions & 14 deletions Src/Private/Get-AbrWinIISSummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrWinIISSummary {
.DESCRIPTION
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.2.0
Version: 0.3.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -29,21 +29,26 @@ function Get-AbrWinIISSummary {
$IISApplicationDefaults = Invoke-Command -Session $TempPssSession { (Get-IISServerManager).ApplicationDefaults }
$IISSiteDefaults = Invoke-Command -Session $TempPssSession { (Get-IISServerManager).SiteDefaults | Select-Object ServerAutoStart,@{name='Directory'; Expression={$_.Logfile.Directory}} }
if ($IISApplicationDefaults -and $IISSiteDefaults) {
$IISServerManagerReport = [PSCustomObject]@{
'Default Application Pool' = ($IISApplicationDefaults).ApplicationPoolName
'Enabled Protocols' = (($IISApplicationDefaults).EnabledProtocols).toUpper()
'Logfile Path' = ($IISSiteDefaults).Directory
'Server Auto Start' = ConvertTo-TextYN ($IISSiteDefaults).ServerAutoStart
try {
$IISServerManagerReport = [PSCustomObject]@{
'Default Application Pool' = ($IISApplicationDefaults).ApplicationPoolName
'Enabled Protocols' = (($IISApplicationDefaults).EnabledProtocols).toUpper()
'Logfile Path' = ($IISSiteDefaults).Directory
'Server Auto Start' = ConvertTo-TextYN ($IISSiteDefaults).ServerAutoStart
}
$TableParams = @{
Name = "IIS Host Settings"
List = $false
ColumnWidths = 25, 25, 25, 25
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$IISServerManagerReport | Table @TableParams
}
$TableParams = @{
Name = "IIS Host Settings"
List = $false
ColumnWidths = 25, 25, 25, 25
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$IISServerManagerReport | Table @TableParams
}
}
catch {
Expand Down
21 changes: 13 additions & 8 deletions Src/Private/Get-AbrWinIISWebAppPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrWinIISWebAppPool {
.DESCRIPTION
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.2.0
Version: 0.3.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -33,14 +33,19 @@ function Get-AbrWinIISWebAppPool {
Blankline
$IISWebAppPoolsReport = @()
foreach ($IISWebAppPool in $IISWebAppPools) {
$TempIISWebAppPoolsReport = [PSCustomObject]@{
'Name' = $IISWebAppPool.Name
'Status' = $IISWebAppPool.State
'CLR Ver' = $IISWebAppPool.ManagedRuntimeVersion
'Pipeline Mode ' = $IISWebAppPool.ManagedPipelineMode
'Start Mode' = $IISWebAppPool.StartMode
try {
$TempIISWebAppPoolsReport = [PSCustomObject]@{
'Name' = $IISWebAppPool.Name
'Status' = $IISWebAppPool.State
'CLR Ver' = $IISWebAppPool.ManagedRuntimeVersion
'Pipeline Mode ' = $IISWebAppPool.ManagedPipelineMode
'Start Mode' = $IISWebAppPool.StartMode
}
$IISWebAppPoolsReport += $TempIISWebAppPoolsReport
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
$IISWebAppPoolsReport += $TempIISWebAppPoolsReport
}

$TableParams = @{
Expand Down
Loading

0 comments on commit 0326835

Please sign in to comment.