01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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 |
Categories: