/ _ \ \_\(_)/_/ _//"\\_ more on JOHLEM.net / \ 0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0 Bluetooth Management Commands: ------------------------------- 1. **Get-PnpDevice** List all Bluetooth devices and adapters. Syntax: Get-PnpDevice -Class Bluetooth Example: Get-PnpDevice | Where-Object { $_.Class -eq "Bluetooth" } 2. **Enable-PnpDevice** Enable a Bluetooth adapter or device. Syntax: Enable-PnpDevice -InstanceId "DeviceInstanceId" -Confirm:$false Example: Enable-PnpDevice -InstanceId "BTH\MS_BTHPAN\6&26793BE3&0&2" -Confirm:$false 3. **Disable-PnpDevice** Disable a Bluetooth adapter or device. Syntax: Disable-PnpDevice -InstanceId "DeviceInstanceId" -Confirm:$false Example: Disable-PnpDevice -InstanceId "BTH\MS_BTHPAN\6&26793BE3&0&2" -Confirm:$false 4. **Get-BluetoothDevice** (Requires Custom Script) List all paired Bluetooth devices. Example Script: Get-WmiObject -Namespace “root\cimv2” -Class Win32_PnPEntity | Where-Object { $_.Name -match “Bluetooth” } 5. **Remove-BluetoothDevice** (Requires Custom Script) Remove (unpair) a Bluetooth device. Example Script: $device = Get-WmiObject -Namespace “root\cimv2” -Class Win32_PnPEntity | Where-Object { $_.Name -match “DeviceName” } $device.Remove() 6. **Start-Service** for Bluetooth Support Start the Bluetooth Support Service if it's not running. Syntax: Start-Service -Name "bthserv" 7. **Stop-Service** for Bluetooth Support Stop the Bluetooth Support Service. Syntax: Stop-Service -Name "bthserv" 8. **Restart-Service** for Bluetooth Support Restart the Bluetooth Support Service. Syntax: Restart-Service -Name "bthserv" 9. **Get-Service** for Bluetooth Status Check the status of the Bluetooth Support Service. Syntax: Get-Service -Name "bthserv" 10. **Add-BluetoothDevice** (Requires Custom Script or Manual Pairing) Pair a new Bluetooth device (typically requires manual intervention). Example Script: ``` Add-BluetoothDevice -DeviceAddress "XX:XX:XX:XX:XX:XX" -Passkey "1234" ``` *Note*: Pairing typically requires user interaction and may not be fully automated via PowerShell. 11. **Test-BluetoothConnection** (Requires Custom Script) Test the connection to a paired Bluetooth device. Example Script: ``` $device = Get-WmiObject -Namespace "root\cimv2" -Class Win32_PnPEntity | Where-Object { $_.Name -match "DeviceName" } Test-Connection -ComputerName $device.Name ``` 12. **Get-BluetoothRadio** (Requires Custom Script) List all Bluetooth radios (adapters). Example Script: ``` Get-WmiObject -Namespace "root\cimv2" -Class Win32_BluetoothRadio ``` 13. **Set-BluetoothRadio** (Requires Custom Script) Enable or disable a Bluetooth radio. Example Script: ``` $radio = Get-WmiObject -Namespace "root\cimv2" -Class Win32_BluetoothRadio $radio.Enable() ``` 14. **Connect-BluetoothDevice** (Requires Custom Script or Manual Connection) Connect to a paired Bluetooth device. Example Script: ``` Connect-BluetoothDevice -DeviceAddress "XX:XX:XX:XX:XX:XX" ``` *Note*: Bluetooth connections, like pairing, often require user interaction. 15. **Disconnect-BluetoothDevice** (Requires Custom Script or Manual Disconnection) Disconnect a paired Bluetooth device. Example Script: ``` Disconnect-BluetoothDevice -DeviceAddress "XX:XX:XX:XX:XX:XX" ``` +----------------------------------------------------------+ | Note: Bluetooth management tasks often require user | | interaction, especially for pairing and connecting| | devices. PowerShell can manage Bluetooth devices | | through custom scripts and service management. | +----------------------------------------------------------+