

Cadet 2nd Class
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-16
10:46
1731 views
Where the **** do we turn off hibernation while imaging.
Hi,
We have been fighting for a while to find a way to turn off hibernation in Windows 7 and 10 while imaging.
For some reason, we always get some workstations that go to sleep just before joining the domain.
We have a GPO the will disable hibernation, but since the computer goes to sleep before, nothing works.
So far we have tried many things in vain:
1- Hibernation disabled in the base image.
2- cmd /c powercfg.exe /hibernate off in the Unattend.xml.
3- Script that change the power scheme to high performance.
Any ideas why?
We have been fighting for a while to find a way to turn off hibernation in Windows 7 and 10 while imaging.
For some reason, we always get some workstations that go to sleep just before joining the domain.
We have a GPO the will disable hibernation, but since the computer goes to sleep before, nothing works.
So far we have tried many things in vain:
1- Hibernation disabled in the base image.
2- cmd /c powercfg.exe /hibernate off in the Unattend.xml.
3- Script that change the power scheme to high performance.
Any ideas why?
3 Replies
m0del101

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-18
14:29
portafreak;2485834 wrote:
Hi,
We have been fighting for a while to find a way to turn off hibernation in Windows 7 and 10 while imaging.
For some reason, we always get some workstations that go to sleep just before joining the domain.
We have a GPO the will disable hibernation, but since the computer goes to sleep before, nothing works.
So far we have tried many things in vain:
1- Hibernation disabled in the base image.
2- cmd /c powercfg.exe /hibernate off in the Unattend.xml.
3- Script that change the power scheme to high performance.
Any ideas why?
How are the machines joining the domain?.
we use the setupcomplete.cmd to launch a powershell script that does our domain join. this is launched directly after sysprep has completed and i have never seen a machine go to sleep during this process.
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-a-custom-script-to-windows-setup
Run a script after setup is complete (SetupComplete.cmd)
Order of operations
After Windows is installed but before the logon screen appears, Windows Setup searches for the SetupComplete.cmd file in the %WINDIR%\Setup\Scripts\ directory.
If a SetupComplete.cmd file is found, Windows Setup runs the script. Windows Setup logs the action in the C:\Windows\Panther\UnattendGC\Setupact.log file.
Setup does not verify any exit codes or error levels in the script after it executes SetupComplete.cmd.
Warning You cannot reboot the system and resume running SetupComplete.cmd. You should not reboot the system by adding a command such as shutdown -r. This will put the system in a bad state.
If the computer joins a domain during installation, the Group Policy that is defined in the domain is not applied to the computer until Setupcomplete.cmd is finished. This is to make sure that the Group Policy configuration activity does not interfere with the script.
m0del101

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-18
14:40
this is the powershell script i use during our MDT gold image process to set high performance.
Try {
$HighPerf = powercfg -l | %{if($_.contains("High performance")) {$_.split()[3]}}
$CurrPlan = $(powercfg -getactivescheme).split()[3]
if ($CurrPlan -ne $HighPerf) {powercfg -setactive $HighPerf
Write-Host "High power set"
}
} Catch {
Write-Warning -Message "Unable to set power plan to high performance"
}


Cadet 2nd Class
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-28
11:43
Thank you so much, we will give your script a try, and see how it goes.