From 054f9783163ba6973479fc1e0762358e5f61f93f Mon Sep 17 00:00:00 2001 From: Michael Grafnetter Date: Wed, 2 Jan 2019 23:51:49 +0100 Subject: [PATCH] Fixed a RFM bug on Windows Server 2016 --- .../PowerShell/New-ADDBRestoreFromMediaScript.md | 8 ++++---- .../ADDBRestoreFromMediaScriptTemplate.ps1 | 8 ++++---- .../en-US/DSInternals.PowerShell.dll-Help.xml | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/PowerShell/New-ADDBRestoreFromMediaScript.md b/Documentation/PowerShell/New-ADDBRestoreFromMediaScript.md index 37c5e67..bf48def 100644 --- a/Documentation/PowerShell/New-ADDBRestoreFromMediaScript.md +++ b/Documentation/PowerShell/New-ADDBRestoreFromMediaScript.md @@ -120,7 +120,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock Rename-Computer -NewName 'LON-DC1' -Force # We explicitly suspend the workflow as Restart-Computer with the -Wait parameter does not survive local reboots. - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' } @@ -135,7 +135,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock # Reboot the computer into the Directory Services Restore Mode. bcdedit.exe /set safeboot dsrepair - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' # Re-encrypt the DB with the new boot key. @@ -167,7 +167,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock # Disable DSRM and do one last reboot. bcdedit.exe /deletevalue safeboot - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' } @@ -292,4 +292,4 @@ This recovery procedure is NOT SUPPORTED by Microsoft. Use at your own risk in s ## RELATED LINKS [Get-BootKey](Get-BootKey.md) -[Get-ADDBDomainController](Get-ADDBDomainController.md) \ No newline at end of file +[Get-ADDBDomainController](Get-ADDBDomainController.md) diff --git a/Src/DSInternals.PowerShell/ADDBRestoreFromMediaScriptTemplate.ps1 b/Src/DSInternals.PowerShell/ADDBRestoreFromMediaScriptTemplate.ps1 index 2922772..811642f 100644 --- a/Src/DSInternals.PowerShell/ADDBRestoreFromMediaScriptTemplate.ps1 +++ b/Src/DSInternals.PowerShell/ADDBRestoreFromMediaScriptTemplate.ps1 @@ -25,7 +25,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock Rename-Computer -NewName '{DCName}' -Force # We explicitly suspend the workflow as Restart-Computer with the -Wait parameter does not survive local reboots. - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' } @@ -40,7 +40,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock # Reboot the computer into the Directory Services Restore Mode. bcdedit.exe /set safeboot dsrepair - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' # Re-encrypt the DB with the new boot key. @@ -72,7 +72,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock # Disable DSRM and do one last reboot. bcdedit.exe /deletevalue safeboot - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' } @@ -101,4 +101,4 @@ schtasks.exe /Change /TN '\Microsoft\Windows\PowerShell\ScheduledJobs\DSInternal # Start the workflow task and let the magic happen. Write-Host 'The {DCName} domain controller will now be restored from media. Up to 3 reboots will follow.' pause -$initTask.RunAsTask() \ No newline at end of file +$initTask.RunAsTask() diff --git a/Src/DSInternals.PowerShell/en-US/DSInternals.PowerShell.dll-Help.xml b/Src/DSInternals.PowerShell/en-US/DSInternals.PowerShell.dll-Help.xml index 1d035b8..39d7f51 100644 --- a/Src/DSInternals.PowerShell/en-US/DSInternals.PowerShell.dll-Help.xml +++ b/Src/DSInternals.PowerShell/en-US/DSInternals.PowerShell.dll-Help.xml @@ -4831,7 +4831,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock Rename-Computer -NewName 'LON-DC1' -Force # We explicitly suspend the workflow as Restart-Computer with the -Wait parameter does not survive local reboots. - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' } @@ -4846,7 +4846,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock # Reboot the computer into the Directory Services Restore Mode. bcdedit.exe /set safeboot dsrepair - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' # Re-encrypt the DB with the new boot key. @@ -4878,7 +4878,7 @@ $initTask = Register-ScheduledJob -Name DSInternals-RFM-Initializer -ScriptBlock # Disable DSRM and do one last reboot. bcdedit.exe /deletevalue safeboot - Restart-Computer -Force -Delay 5 + shutdown.exe /r /t 5 Suspend-Workflow -Label 'Waiting for reboot' }