Turn ON Bluetooth on a Lenovo device using SCCM and PowerShell

  • Turn ON Bluetooth on a Lenovo device using SCCM and PowerShell

    Posted by Roddy Gelberty on 31 July 2020 at 2:13 pm

    How can I turn ON or OFF a attribute in the BIOS for a Lenovo device? I’ve been given a HTA to change attributes locally or remotely. But, how can I change attributes using PowerShell on thousands of devices? See image of the HTA below.

    Roddy Gelberty replied 4 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • 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.

Log in to reply.

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.