# Script to disable Sign-in options on Windows

When it comes to securing a Windows computer, one method is to set up a Sign-in option for accessing your account. There may be times when you want to disable the Sign-in options for specific purposes, such as troubleshooting or maintenance. You can use the following scripts to enable or disable the Sign-in options quickly and efficiently on multiple endpoints, without navigating to the settings menu. The [Execute Custom Script](https://www.hexnode.com/mobile-device-management/help/executing-custom-scripts-for-windows/) action lets you execute these customized scripts on different endpoints remotely.

 Disclaimer:The sample scripts provided below are adapted from third-party open-source sites.

 

PowerShell script
-----------------

### To disable Windows Sign-in options:

The following PowerShell command disables the ability to choose sign-in options on the login screen.

Disable Windows sign-in options

Set-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\current\\device\\Settings -Name "AllowSignInOptions" -Value 0 

   1

  Set-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\current\\device\\Settings -Name "AllowSignInOptions" -Value 0 

   

 

  

On executing this command, the following Sign-in options get disabled:

- Facial recognition (Windows Hello)
- Fingerprint recognition (Windows Hello)
- PIN (Windows Hello)
- Security Key
- Password
- Picture password

### To enable Windows Sign-in options:

The following PowerShell command re-enables the sign-in options for the users.

Disable Windows sign-in options

Set-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\current\\device\\Settings -Name "AllowSignInOptions" -Value 1 

   1

  Set-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\current\\device\\Settings -Name "AllowSignInOptions" -Value 1 

   

 

  

### To disable Windows Hello options:

The PowerShell command specified below disables the ability to choose Windows Hello options for the user.

Disable Windows sign-in options

Set-ItemProperty -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork -Name "Enabled" -Value 0 

   1

  Set-ItemProperty -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork -Name "Enabled" -Value 0 

   

 

  

On executing this command, the following Windows Hello options get disabled:

16. Facial recognition (Windows Hello)
17. Fingerprint recognition (Windows Hello)
18. PIN (Windows Hello)
### To enable Windows Hello options:

The following PowerShell command re-enables the ability to choose Windows Hello options for the user.

Disable Windows sign-in options

Set-ItemProperty -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork -Name "Enabled" -Value 1 

   1

  Set-ItemProperty -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork -Name "Enabled" -Value 1 

   

 

  

 Notes:- The error message “Set-ItemProperty : Cannot find path” means that there is no such registry key present at the path specified. To resolve that you need to create a new registry key at the specified path in the local machine.
- For eg: To disable Windows Hello options on Windows, use the below script:
Disable Windows Hello options on Windows

New-Item -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork Set-ItemProperty -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork -Name "Enabled" -Value 0 

   1

2

  New-Item -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork

Set-ItemProperty -Path HKLM:\\SOFTWARE\\Policies\\Microsoft\\PassportForWork -Name "Enabled" -Value 0 

   

 

  

- It is recommended to manually validate the script execution on a system before executing the action in bulk.
- Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.