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: Scheduled Task to Backup Local Files to remote UNC Path

Set Script Execution Policy on Host PS H:\> Set-ExecutionPolicy RemoteSignedExecution Policy ChangeThe execution policy helps…

PowerShell: Quick Script to Get Storage Utilization

$volumes = (gwmi -Class win32_volume -Filter "DriveType!=5" -ea stop| ?{$_.DriveLetter -ne $isnull}|` Select-object @{Name="Letter";Expression={$_.DriveLetter}},` @{Name="Label";Expression={$_.Label}},`…

Exchange: New-MoveRequest

New-MoveRequest -Identity '[email protected]' -TargetDatabase "DB01" -WhatIfNew-MoveRequest -Identity '[email protected]' -TargetDatabase "DB01"Get-Mailbox -Database DB01 | New-MoveRequest -TargetDatabase…