Reply To: Turn ON Bluetooth on a Lenovo device using SCCM and PowerShell

  • Roddy Gelberty

    Member
    31 July 2020 at 2:23 pm

    Please create an SCCM task sequence and use the run PowerShell script step. Deploy the task sequence. Use the following script.

    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment

    $BIOSpassword = $tsenv.Value('BIOSpassword')

    $devcs = Get-WmiObject -Class win32_computersystemproduct

    $strBlueToothStatus = gwmi -class Lenovo_BiosSetting -namespace root\wmi -ErrorAction SilentlyContinue | Where-Object {$_.CurrentSetting.split(",",[StringSplitOptions]::RemoveEmptyEntries) -eq "BluetoothAccess"}

    if (!($($strBlueToothStatus.CurrentSetting) -eq "BluetoothAccess,Enable"))

    {

    (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("BluetoothAccess,Enable,$BIOSpassword,ascii,us")

    (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings("$BIOSpassword,ascii,us”)

    }

    In your target SCCM Collection add a collection variable called ‘BIOSpassword’ and assign it your password.