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

  • Roddy Gelberty

    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.

DCOM hardening issue.

This application fails to authenticate with WMI on the SCCM server because Microsoft has not yet hardened DCOM on their Windows Preinstallation Environment. We are working on a different approach, but it will only be released during the first quarter of 2024. But until that time, the only workaround will be to uninstall the update corresponding to KB5004442.