# Windows Passcode Profile fails Last updated: July 24, 2026 ## Problem Unable to apply windows passcode profile policy. ## Cause This error happens if a Microsoft account is present on the devices. ## Resolution When passcode policy fails you need to check the following: 1. Presence of any Microsoft account. 2. If the local user setting is altered. ### Steps to verify the presence of any Microsoft account: 1. Open **PowerShell** as admin on the machine on which the Passcode profile fails. 2. Run the command **Get-LocalUser | select \*** to get all the local user accounts. 3. Check the PrincipalSource of each entry, any entry with MicrosoftAccount or other domain account might be causing the issue. 4. Passcode policy will not work on devices with Microsoft account. [Learn more.](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn282287(v=ws.11)#password-length-and-complexity-supported-by-account-types) ### Steps to verify if local user setting is altered: 1. In Windows search, type in **lusrmgr.msc** and open the top suggestion. 2. You will be presented with a list of users and groups, click on each non-local user and check if **User cannot change password** field is unchecked. If not, kindly uncheck that. **Note:** The policy fails for Microsoft local account, but for domain accounts (AD accounts), the setting in domain account precedes the applied MDM policy.