Disable FastBoot
Summary
The script will attempt to modify the registry keys to disable fastboot on the Windows workstations if it is not already disabled.
Sample Run
Dependencies
- Custom Field - Company - Disable_FastBoot
- Custom Field - Endpoint - FastBoot_Disabled
- Custom Field - Endpoint - Disable_Fastboot_Exclusion
- Custom Field - Site - Disable_Fastboot_Exclusion
- Device Group - Disable FastBoot
Task Creation
Create a new Script Editor
style script in the system to implement this task.
Name: Disable FastBoot
Description: The script will attempt to modify the registry keys to disable fastboot on the Windows workstations if it is not already disabled.
Category: Custom
Task
- Start by adding a row. You can do this by clicking the
Add Row
button at the bottom of the script page.
This function will appear.
Row 1 Function: PowerShell Script
Search and select the PowerShell Script
function.
Paste in the following PowerShell script and set the expected time of script execution to 300
seconds. Click the Save
button.
$registryPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power'
if (Test-Path $registryPath) {
$hiberbootEnabled = Get-ItemProperty -Path $registryPath -Name HiberbootEnabled -ErrorAction SilentlyContinue
if ($hiberbootEnabled.HiberbootEnabled -eq 1) {
Set-ItemProperty -Path $registryPath -Name HiberbootEnabled -Value 0
$hiberbootEnabled = Get-ItemProperty -Path $registryPath -Name HiberbootEnabled -ErrorAction SilentlyContinue
if ($hiberbootEnabled.HiberbootEnabled -ne 0) {
return 'Failed'
} else {
return 'Success'
}
} else {
return 'Success'
}
} else {
return 'Success'
}
Row 2 Logic: If Then Else
Row 2a Condition: Output Contains
Type Success
in the Input Value or Variable
field and press Enter
.
Row 2b Function: Set Custom Field
Add a new row by clicking on the Add row
button.
Search and select the Set Custom Field
function.
Search and select FastBoot_Disabled
in the Search Custom Field
field, set True
in the Value
field, and click the Save
button.
Row 2d Function: Set Custom Field
Add a new row by clicking on the Add row
button in the Else
section.
Search and select the Set Custom Field
function.
Search and select FastBoot_Disabled
in the Search Custom Field
field, set False
in the Value
field, and click the Save
button.
Row 2c Function: Script Exit
Add a new row by clicking on the Add row
button.
Search and select the Script Exit
function.
The following function will pop up on the screen:
Paste the following lines in the Error Message
field and click the Save
button.
Failed to disable FastBoot.
Click the Save
button at the top-right corner of the screen to save the script.
Completed Script
Deployment
The task should be scheduled to run once per day against the Disable FastBoot device group.
- Go to
Automation
>Tasks.
- Search for the
Disable FastBoot
task. - Select the concerned task.
- Click on the
Schedule
button to schedule the task.
- This screen will appear.
- Click the
Does not repeat
button.
- This pop-up box will appear.
- Click the
OK
button without making any changes to run the taskEvery day
.
- Recurrence will be updated to
Every Day
.
- Select the
Device Groups
option in theTargeted Resources
section.
- Search and select the Disable FastBoot device group.
- Now click the
Run
button to initiate the task.
- The task will start appearing in the Scheduled Tasks.
Output
- Script Log
- Custom Field