Posted On July 2, 2021

PowerShell: Disable Windows Hello

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Disable Windows Hello
function disableWindowsHello{
    $regHive='REGISTRY::HKLM\SOFTWARE\Policies\Microsoft\PassportForWork'
    $refreshEnv=$false    
    if (!(Test-Path $regHive)){
        Write-Host "Creating registry path $regHive"
        New-Item -Path $regHive -Force
    }
    if ((get-itemproperty $regHive -EA Ignore).Enabled -ne 0){
        New-ItemProperty -Path $regHive -Name 'Enabled' -Value 0 -PropertyType DWORD -Force
        $refreshEnv=$true
    }
    if ((get-itemproperty $regHive -EA Ignore).DisablePostLogonProvisioning -ne 1){
        New-ItemProperty -Path $regHive -Name 'DisablePostLogonProvisioning' -Value 1 -PropertyType DWORD -Force
        $refreshEnv=$true
    }
    if($refreshEnv){
        write-host 'refreshing environment...'
        & 'RUNDLL32.EXE' USER32.DLL, UpdatePerUserSystemParameters 1, True
    }
    write-host "Windows Hello has been disabled on $env:computername"
}
disableWindowsHello

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Disable Annoying Windows Updates Notifications

This little snippet would render these notices as void. # This snippet is to add…

PowerShell: Enable TLS 1.2 on legacy servers

# Enable TLS 1.2 on legacy servers function enableTls12{ $windowsVersionNumber=[System.Environment]::OSVersion.Version.Major; #$windowsName=(Get-CimInstance -ClassName Win32_OperatingSystem).Caption; #The term…

Install Apps on Remote Computers via WinRM & Chocolatey

Version A: [string[]]$computers=@( 'SERVER01', 'SERVER02', 'SERVER03' ) [string]$chocoAppName='pgadmin4' [version]$minVersion='6.0' $results=[hashtable]@{} foreach ($computer in $computers){ $session=new-pssession…