Skip to content

Commit 5751f68

Browse files
committed
Update JobsTimeOut to 900 seconds and improve timeout handling in Invoke-CommandWithTimeout
1 parent 358965c commit 5751f68

File tree

5 files changed

+26
-21
lines changed

5 files changed

+26
-21
lines changed

AsBuiltReport.Microsoft.AD.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"EnableDiagramSignature": false,
4343
"SignatureAuthorName": "",
4444
"SignatureCompanyName": "",
45-
"JobsTimeOut": 600
45+
"JobsTimeOut": 900
4646
},
4747
"InfoLevel": {
4848
"_comment_": "0 = Disabled, 1 = Enabled, 2 = Adv Summary, 3 = Detailed",

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- Migrate function located in SharedUtilsFunctions.ps1 to its own file for better modularity and maintainability
2727
- Change export diagrams format to "PDF" by default
2828
- Improve Get-RequiredFeatures function to better handle feature retrieval and error handling
29+
- Improve timeout warning message in Invoke-CommandWithTimeout
2930

3031
### Fixed
3132

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ The **Options** schema allows certain options within the report to be toggled on
184184
| Exclude.Domains | Array List | Empty | Allow to filter on AD Domain FQDN |
185185
| Include.DCs | Array List | Empty | Allow only a list of Active Directory Domain FQDN to document. |
186186
| Include.Domains | Array List | Empty | Allow only a list of Active Directory Domain Controller FQDN to document. |
187-
| JobsTimeOut | Int | 600 | Allow to set the timeout (in seconds) for remote jobs execution |
187+
| JobsTimeOut | Int | 900 | Allow to set the timeout (in seconds) for remote jobs execution |
188188
| PSDefaultAuthentication | Negotiate/Kerberos | Negotiate | Allow to set the value of the PSRemoting authentication method. |
189189
| | | | For Workgroup authentication Negotiate value is required. |
190190
| ShowDefinitionInfo | true/false | False | Toggle to enable/disable Microsoft AD term explanations |

Src/Private/Get-AbrDomainSection.ps1

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,25 @@ function Get-AbrDomainSection {
8888
}
8989
}
9090
}
91-
if ($HealthCheck.DomainController.Diagnostic) {
92-
try {
93-
$DCDiagObj = foreach ($DC in $DCs) {
94-
if (Get-DCWinRMState -ComputerName $DC -DCStatus ([ref]$DCStatus)) {
95-
Get-AbrADDCDiag -Domain $Domain -DC $DC
96-
}
97-
}
98-
if ($DCDiagObj) {
99-
Section -Style Heading4 'DC Diagnostic' {
100-
Paragraph "The following section provides a summary of the Active Directory DC Diagnostic."
101-
BlankLine
102-
$DCDiagObj
103-
}
104-
}
105-
} catch {
106-
Write-PScriboMessage -IsWarning "Error: Connecting to remote server $DC failed: WinRM cannot complete the operation. ('DCDiag Information)"
107-
Write-PScriboMessage -IsWarning $_.Exception.Message
108-
}
109-
}
91+
# if ($HealthCheck.DomainController.Diagnostic) {
92+
# try {
93+
# $DCDiagObj = foreach ($DC in $DCs) {
94+
# if (Get-DCWinRMState -ComputerName $DC -DCStatus ([ref]$DCStatus)) {
95+
# Get-AbrADDCDiag -Domain $Domain -DC $DC
96+
# }
97+
# }
98+
# if ($DCDiagObj) {
99+
# Section -Style Heading4 'DC Diagnostic' {
100+
# Paragraph "The following section provides a summary of the Active Directory DC Diagnostic."
101+
# BlankLine
102+
# $DCDiagObj
103+
# }
104+
# }
105+
# } catch {
106+
# Write-PScriboMessage -IsWarning "Error: Connecting to remote server $DC failed: WinRM cannot complete the operation. ('DCDiag Information)"
107+
# Write-PScriboMessage -IsWarning $_.Exception.Message
108+
# }
109+
# }
110110
try {
111111
$ADInfraServices = foreach ($DC in $DCs) {
112112
if (Get-DCWinRMState -ComputerName $DC -DCStatus ([ref]$DCStatus)) {

Src/Private/Invoke-CommandWithTimeout.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function Invoke-CommandWithTimeout {
4646
[int]$TimeoutSeconds = $Options.JobsTimeOut
4747
)
4848

49+
if (-not $TimeoutSeconds) {
50+
$TimeoutSeconds = 900
51+
}
52+
4953
# Start the command as a job
5054
$job = Invoke-Command -Session $Session -ScriptBlock $ScriptBlock -AsJob
5155

0 commit comments

Comments
 (0)