(146) Microsoft Intune - Disable Fast Startup
- Mr B SOE way
- Sep 28, 2024
- 2 min read
Updated: Oct 3, 2024
Had a customer who wanted to disable fast startup which can be found here under Power Options.
What is Fast Startup?
Fast Startup is a Windows feature designed to reduce the time it takes for the computer to boot up from being fully shut down. With Fast Startup enabled it can prevent you from installing Windows updates. This happens because an update requires a full shutdown to be brought into effect. A reboot will complete the installation while Fast Startup is enabled, but a shutdown won't.
You can use my Github repo to deploy it as a PowerShell script.
Alternatively you can package it up as a Win32 app, prepare the following:
For Install.ps1
#region Config
$AppName = $PName + "_"+ $Pversion +"_Package"
$client = "Mr B SOE Way"
$logPath = "$env:ProgramData\$client\logs"
$logFile = "$logPath\Disable Fast Startup.log"
#endregion
#region Logging
if (!(Test-Path -Path $logPath)) {
New-Item -Path $logPath -ItemType Directory -Force | Out-Null
}
Start-Transcript -Path $logFile -Force
Write-Host "Disable Fast Startup."
if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -force -ea SilentlyContinue };
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name 'HiberbootEnabled' -Value 0 -PropertyType DWord -Force -ea SilentlyContinue;
Write-Host "Script completed successfully.."
Stop-Transcript
For Detect.ps1
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power"
$Name = "HiberbootEnabled"
$value = "0"
Try {
$Registry = Get-ItemProperty -Path $Path -Name $Name -ErrorAction Stop | Select-Object -ExpandProperty $Name
If ($Registry -eq $Value) {
Write-Output "Compliant"
Exit 0
} else {
Write-Warning "Not Compliant"
Exit 1
}
}
Catch {
Write-Warning "Not Compliant"
Exit 1
}
Then package the app with IntuneWin32 Wrapper, then upload to https://intune.microsoft.com/ as a Win32 app with the following:
Under Program, where the following is configured:
Install command: %windir%\sysnative\windowspowershell\v1.0\powershell.exe -executionPolicy bypass -windowstyle hidden -file .\Install.ps1
Uninstall command: nouninstallcmd
Install behaviour: System
Under Detection Rules, use the 'Detect.ps1' as mentioned above.
To confirm that changes have appeared
Run this in ISE and it will show 'Compliant'
Comments