Skip to main content

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

Sample Run 1
Sample Run 2

Dependencies

Task Creation

Create a new Script Editor style script in the system to implement this task.

Task Creation 1
Task Creation 2

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 Creation 3

Task

  1. Start by adding a row. You can do this by clicking the Add Row button at the bottom of the script page.
    Add Row
    This function will appear.
    Function Appears

Row 1 Function: PowerShell Script

Search and select the PowerShell Script function.
Select PowerShell Script 1
Select PowerShell Script 2
Select PowerShell Script 3

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 2 Logic
Row 2 Logic 2

Row 2a Condition: Output Contains

Type Success in the Input Value or Variable field and press Enter.
Output Contains

Row 2b Function: Set Custom Field

Add a new row by clicking on the Add row button.
Add Row 2

Search and select the Set Custom Field function.
Select Set Custom Field 1
Select Set Custom Field 2

Search and select FastBoot_Disabled in the Search Custom Field field, set True in the Value field, and click the Save button.
Set FastBoot_Disabled
FastBoot Disabled

Row 2d Function: Set Custom Field

Add a new row by clicking on the Add row button in the Else section.
Add Row Else

Search and select the Set Custom Field function.
Select Set Custom Field 3
Select Set Custom Field 4

Search and select FastBoot_Disabled in the Search Custom Field field, set False in the Value field, and click the Save button.
Set FastBoot_Disabled False
FastBoot Disabled False

Row 2c Function: Script Exit

Add a new row by clicking on the Add row button.
Add Row Script Exit

Search and select the Script Exit function.
Select Script Exit

The following function will pop up on the screen:
Function Pop-up

Paste the following lines in the Error Message field and click the Save button.

Failed to disable FastBoot.

Error Message

Click the Save button at the top-right corner of the screen to save the script.
Save Script

Completed Script

Completed Script 1
Completed Script 2

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.
    Schedule Task
  • This screen will appear.
    Schedule Screen
  • Click the Does not repeat button.
    Does Not Repeat
  • This pop-up box will appear.
    Pop-up Box
  • Click the OK button without making any changes to run the task Every day.
    OK Button
  • Recurrence will be updated to Every Day.
    Recurrence Updated
  • Select the Device Groups option in the Targeted Resources section.
    Targeted Resources
  • Search and select the Disable FastBoot device group.
    Select Device Group
  • Now click the Run button to initiate the task.
    Run Task
  • The task will start appearing in the Scheduled Tasks.
    Scheduled Tasks 1
    Scheduled Tasks 2

Output

  • Script Log
  • Custom Field