--- title: "Turn Bluetooth status On/Off on Windows devices" slug: "turn-bluetooth-status-onoff-on-windows-devices" updated: 2024-02-02T13:34:54Z published: 2024-02-02T13:34:54Z canonical: "help.scalefusion.com/turn-bluetooth-status-onoff-on-windows-devices" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.scalefusion.com/llms.txt > Use this file to discover all available pages before exploring further. # Turn Bluetooth status On/Off on Windows devices The following PowerShell script helps the IT Admins to remotely turn On/Off the Bluetooth state on multiple managed Windows devices. 1. Create a file on your desktop, for example, **turn_on_off_bluetooth.ps1** and open it in a text editor like notepad++ 2. Copy the contents below to the file or click [here](https://cdn.document360.io/175c0eac-012f-4410-bdc5-ac60794f82d8/Images/Documentation/Script%20to%20toggle%20Bluetooth%20status.ps1) to download the file. 1. Set the **$BluetoothStatus** variable to "**On**" or "**Off**" based on your desired Bluetooth status. ```powershell $BluetoothStatus = "Off" # Set this variable to "On" or "Off" based on your desired Bluetooth status If ((Get-Service bthserv).Status -eq 'Stopped') { Start-Service bthserv } Add-Type -AssemblyName System.Runtime.WindowsRuntime $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0] Function Await($WinRtTask, $ResultType) {    $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)    $netTask = $asTask.Invoke($null, @($WinRtTask))    $netTask.Wait(-1) | Out-Null    $netTask.Result } [Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null [Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null $radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]]) $bluetooth = $radios | ? { $_.Kind -eq 'Bluetooth' } [Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null Await ($bluetooth.SetStateAsync($BluetoothStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null ``` 3. Follow [our guide](/docs/deploy-powershell-scripts-using-scalefusio) to upload & publish the PowerShell script using Scalefusion Dashboard. > [!CAUTION] > #### > > Please note that to use the PowerShell scripts, the Scalefusion MDM Agent Application must be installed on the device(s). Please follow [our guide](/docs/scalefusion-mdm-agent-application) to publish and install the Scalefusion MDM Agent Application. > [!CAUTION] > #### Notes: > > 1. The scripts and their contents are sourced from various albeit authenticated Microsoft sources and forums. > 2. Please validate the scripts on a test machine before deploying them on all your managed devices. > 3. Scalefusion has tested these scripts, however, Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the incorrect usage of these scripts.