23 thoughts on “A case of the unexplained: Intune password policy and forced local account password changes

  1. Having the same issue. It’s crazy. I’ve spend hours tracking it back and the fact that this cannot be easily disabled is crazy! Especially that Intune itself offers an autologon / kiosk profile. And it does not work out of the box.

  2. This didn’t work or I’m missing something/wrong expectation. Ran the posh script on a test PC and it changed the LSP as indicated but that didn’t change the checkbox on the accounts re “User must change password at next logon”. Still getting EAS message.

    1. The PS script is simply an alternative way to deploy a password policy. It won’t remove or replace a password policy already set by Intune. Once the Intune password policy has applied, I couldn’t find any way to remove it from the device.

    2. I had a similar issue with Teams Rooms where an Intune password policy was once applied and then removed. But the EAS password policy stayed and disabled the Teams Rooms Autologon after every restart. So I have reached out to MS support and they gave me this solution to remove the EAS policy completely, which actually worked for me:

      Ā· Log into your Team Room System.
      Ā· First, let’s “sync” the changes from InTune by going to “Start -> Settings -> Accounts -> Access work or School”.
      Ā· Click on the “Connect to [CompanyName Azure AD] and then click on “Info”.
      Ā· In the “Managed by CompanyName screen”, scroll down and click on “Sync”.
      Ā· Wait for the sync to finish.
      Ā· Now for the fun part: open up the Registry Editor.
      Ā· Go to the “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\EAS” key.
      Ā· Under the “EAS” key, delete the “Policies” folder (and MDM sub-folder if it exists).
      Ā· Go to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\OMADM\Accounts\”
      Ā· There will be a folder with a GUID under that “Accounts” key: make a note of the GUID that is shown there. That’s your “EnrollmentID”.
      Ā· Go to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\Providers” and locate the folder under that key that has the same GUID as your EnrollmentID.
      Ā· Under the “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\Providers\[ENROLLMENTID]\default\Device\” go to the “DeviceLock” folder.
      Ā· Delete all the keys in the “DeviceLock” folder: keys like “DevicePasswordEnabled”, “AllowSimpleDevicePassword”, “AlphanumericDevicePasswordRequired” should be deleted. Seriously, feel free to delete all the keys in there.
      Ā· Now, this is important, go to the “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\DeviceLock” registry folder.
      Ā· This is where the settings from each Policy Provider are copied into and this indicates which settings are currently active! So, you need to delete all the keys you find in there… for example “DevicePasswordEnabled”, “DevicePasswordEnabled_ProviderSet”, “DevicePasswordEnabled_WinningProvider”, Ā “AllowSimpleDevicePassword”, “AllowSimpleDevicePassword_ProviderSet”, etc, etc… there might a bunch of keys in there to delete so have fun deleting them all.
      Ā· Once your “spring cleanup” of the registry is done, open a command prompt in admin mode.
      Ā· Issue a good ol’ GPUPDATE /FORCE to ensure that the “AdminAutoLogon” and other settings that are supposed to be pushed by your GPO are applied to your domain joined Team Room System and are set correctly.
      Ā· If you want to be paranoid, go back to the Registry Editor and then go to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon”… and verify that “AdminAutoLogon” is set to “1” and that the “DefaultUserName” user name is set to “Skype” as it should be (as per your GPO).
      Ā· When you are ready, close everything and reboot the Team Room System.
      Finally, over the next few days, monitor the room to make sure the “Auto Logon” thing works correctly.

      So the trick is to delete the keys here:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\EAS
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\Providers\[ENROLLMENTID]\default\Device\DeviceLock
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\DeviceLock

      I hope it helps you with your issue.

      1. Thanks so much for this information. Here’s a quick PowerShell script to address.

        $enrollmentID = ((Get-Childitem ‘HKLM:\SOFTWARE\Microsoft\Provisioning\OMADM\Accounts\’).Name).Split(‘\’)[-1]

        $deviceLockKeys = @(
        ‘HKLM:\SYSTEM\CurrentControlSet\Control\EAS’
        “HKLM:\SOFTWARE\Microsoft\PolicyManager\Providers\$enrollmentID\default\Device\DeviceLock”
        ‘HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\DeviceLock’
        )

        foreach ($key in $deviceLockKeys) {
        Remove-Item $key -Force -ErrorAction Continue
        }

  3. Encountered same issue with ALL our local accounts on PC’s. LapsAdmin and other accounts were all affected by the “Change Password” issue when trying to use them.

    Annoying as heck. Logged a MS Sev A ticket as retail stores is affected.

  4. So funnily enough, a compliance policy from Intune caused this error for me even though I didn’t have any of the password restrictions set with it (thanks Microsoft!). So, all of my computers (over 5oo) are now jacked up with the local accounts. So, that’s fun. But I tried this and still getting the EAS error. I’m just having to result in manually resetting them on all of the machines… yay!

  5. This is still an issue. Microsoft lists that this can happen as “Important” on the DeviceLock CSP page, but does nothing to steer you away from the train wreck that this is when building policies in Intune. There should be big flashing red sirens when setting this in Intune!

    The script provided above to clear keys the EAS and DeviceLock keys did not help me. What I resorted to, was using ‘net user ‘ to clear the flag. TIP: If you encounter this and have Microsoft Defender for Endpoint, live response can be used to upload a script to do this (on a per machine basis).

  6. Our only work solution was to create a new local admin and have LAPS manages it.
    *Ensure that the LAPS Password Complexity settings to have Large Letters + Small Letters + Numbers: anything less than this configuration will not work on the affected devices.

    We use Intune Detect & Remediation Scripts
    Detection script:
    $userName = “NewAdminAccount”
    $Userexist = (Get-LocalUser).Name -Contains $userName
    if ($userexist) {
    Write-Host “$userName exist”
    Exit 0
    }
    Else {
    Write-Host “$userName does not Exists”
    Exit 1
    }

    Remediation Script:

    $userName = “NewAdminAccount”
    $userExist = (Get-LocalUser).Name -Contains $userName
    $Pass = ConvertTo-SecureString -String “PasswordHere” -AsPlainText -Force

    if ($userExist -eq $false) {
    try {
    New-LocalUser -Name $userName -Description “LAPS Account” -Password $Pass
    Set-LocalUser -Name $userName -PasswordNeverExpires 1
    Net user $userName /PASSWORDREQ:YES
    Add-LocalGroupMember -Group “Administrators” -Member $userName
    Exit 0
    }
    catch {
    Write-Error $_
    Exit 1
    }
    }

  7. Our only work solution was to create a new local admin and have LAPS manages it.
    *Ensure that the LAPS Password Complexity settings to have Large Letters + Small Letters + Numbers: anything less than this configuration will not work on the affected devices.

    We use Intune Detect & Remediation Scripts
    Detection script:
    $userName = “NewAdminAccount”
    $Userexist = (Get-LocalUser).Name -Contains $userName
    if ($userexist) {
    Write-Host “$userName exist”
    Exit 0
    }
    Else {
    Write-Host “$userName does not Exists”
    Exit 1
    }

    Remediation Script:

    $userName = “NewAdminAccount”
    $userExist = (Get-LocalUser).Name -Contains $userName
    $Pass = ConvertTo-SecureString -String “PasswordHere” -AsPlainText -Force

    if ($userExist -eq $false) {
    try {
    New-LocalUser -Name $userName -Description “LAPS Account” -Password $Pass
    Set-LocalUser -Name $userName -PasswordNeverExpires 1
    Net user $userName /PASSWORDREQ:YES
    Add-LocalGroupMember -Group “Administrators” -Member $userName
    Exit 0
    }
    catch {
    Write-Error $_
    Exit 1
    }
    }

  8. When copying text from the exported file and using it in this PS script, ensure to re-add the ` in line signature=”`$CHICAGO`$” as required for PS rules with these types of quotes, or the script will fail to complete.

  9. I noticed after script run 2 files end up in the script root where its run from (testing locally), secedit.sdb and secedit.jfm. They don’t seem to be needed but does anyone know why this occurs and is it needed at all and how to stop this?

  10. Ensure when doing a copy/paste from the exported file to re-include the ` marks in line signature=”`$CHICAGO`$” when using the supplied PS script, as needed for correct PS interpretation, or the start-process secedit command will not work as intended.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.