ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins. Read more for important details.
ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins.Read more for important details.
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
1789 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?
Labels (1)
0 Likes
3 Replies
Absent Member.
Absent Member.

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.
0 Likes
Absent Member.
Absent Member.

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"
}

0 Likes
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

Thank you so much, we will give your script a try, and see how it goes.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.