Hi @eugene Thanks for reaching out to Hexnode Connect!
Yes, you can use scripts to modify the device name which ultimately changes the Bluetooth name.
Script to change the device name and Bluetooth name on macOS
You can execute the following script to change the Bluetooth name on macOS via Hexnode’s Execute Custom Script feature.
#!/bin/bash
newdevicename="NewDeviceName"
sudo scutil --set ComputerName "$newdevicename"
echo "Device and Bluetooth name changed to $newdevicename"
In the above-mentioned bash script, replace “NewDeviceName” with the desired name you wish to set as the device name or Bluetooth name.
After executing the script, the device and Bluetooth name will be changed on the device’s end. You can check the script’s output from the Action History tab.
Script to change the device name and Bluetooth name on Windows
To change the Bluetooth name on Windows devices via Hexnode’s Execute Custom Script feature, execute the following PowerShell script.
param(
[string] $deviceName
)
try{
if($deviceName)
{
Write-Host "Changing device name to:"$deviceName
Rename-Computer -NewName $deviceName
}
else
{
Write-Host "Please provide device name as argument"
}
}
catch
{
Write-Host $_.Exception.Message
}
While executing the script, you need to pass the desired device name that you wish to set on the device in the Arguments field. Utilize the wildcards supported by Hexnode to pass the Arguments, enabling you to execute the script on multiple devices simultaneously.
After executing the script, execute the “Restart Device” action to reflect the changes on the device’s end.
I hope this helps. Feel free to contact us at any time if you have any further queries or concerns.
Regards,
Daniel Mark
Hexnode UEM