This is a text-only version of the following page on https://raymii.org:
---
Title       :   Exchange 2010 - OWA - Lock user after x amount of failed logins
Author      :   Remy van Elst
Date        :   19-12-2012
URL         :   https://raymii.org/s/tutorials/Exchange_2010_OWA_lock_users_after_x_amount_of_failed_logins.html
Format      :   Markdown/HTML
---



This is a tutorial to set up automatic user lockout in Exchange 2010 - Outlook
Web Acces (OWA). When a user does 5 wrong login attempts, he/she is locked out
from the webinterface. After for example 5 minutes he or she is unlocked again
automatically. This helps you mitigate brute force attacks, since an attacker
can only try 1 password/minute, but the user will not be blocked for to long.
Exchange 2010 has some special register settings to make IIS stop caching,
otherwise it would not work.

<p class="ad"> <b>Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:</b><br><br> <a href="https://leafnode.nl">I'm developing an open source monitoring app called  Leaf Node Monitoring, for windows, linux & android. Go check it out!</a><br><br> <a href="https://github.com/sponsors/RaymiiOrg/">Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.</a><br><br> <a href="https://www.digitalocean.com/?refcode=7435ae6b8212">You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days. </a><br><br> </p>


#### Group Policy settings

Execute the following steps on one of your domain controllers.

`Start` -> `Administrative Tools` -> `Group Policy Editor`.

Right click the "Default Domain Policy" (or any other policy where you might
want to apply this).

Click `Edit`

Navigate to: `Computer Configuration` -> `Policies` -> `Windows Settings` ->
`Security Settings` -> `Account Policies` -> `Account Lockout Policy`.

Set the following values: - "Account Lockout Duration": 5 minutes - "Account
Lockout Threshold": 5 invalid logon attempts - "Reset Account Lockout Counter
After": 5 minutes

Adapt this to your own time/threshold if you feel so.

Also make sure the group policy is enforced.

Lets move on to IIS to make sure that OWA does not cache the login token.

### IIS / OWA

Outlook Web Access operates via the IIS server, which when using form based
authentication caches login tokens for a set amount of time. [(See this
link)][2] and [this one][3].

If you have set the above group policy and you test in on the outlook web access
of the exchange server, you will notice that if you have done more than 5 failed
logins you can still login with the good password.

On your IIS server(s) where OWA resides execute the following:

Click `Start`

Click `Run`

Type: `regedit`

Navigate to the following key:

`HKEY_LOCAL_MACHINESystemCurrentControlSetServicesInetInfoParameters`

Click the `Edit` menu, then the `Add` menu, select a `32 bit DWORD` (or just
`DWORD`).

Name it: `UserTokenTTL`

Then set its value to `30`. This means that user tokens will be cached for 30
seconds by IIS.

Now that is also solved.

### Bonus: Active Directory Saved Search to view Locked Out users

Open the `Active Directory Users && Computers` window from the `Administrative
Tools` menu.

Right Click the `Saved Queries`, select `New` -> `Query`.

Name: `Locked Out users` Description: `-`

Click `Define Query`. Click the `Find` dropdown, select `Custom Search`. Select
the `Advanced` tab.

Paste the following LDAP Query:



   (&&(&&(&&(objectCategory=Person)(objectClass=User)(lockoutTime>=1))))


Click `OK`.

Click `OK`.

Now if a users calls you that they cannot login, you can see if they are locked
out via that Saved Search. (Note that you might have to refresh the view a few
times before seeing it.)

  [1]: https://www.digitalocean.com/?refcode=7435ae6b8212
  [2]: http://support.microsoft.com/kb/173658/en-us
  [3]: https://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis/6b2e7fcd-5fad-4ac8-ac0a-dcfbe771e9e1.mspx

---

License:
All the text on this website is free as in freedom unless stated otherwise.
This means you can use it in any way you want, you can copy it, change it
the way you like and republish it, as long as you release the (modified)
content under the same license to give others the same freedoms you've got
and place my name and a link to this site with the article as source.

This site uses Google Analytics for statistics and Google Adwords for
advertisements. You are tracked and Google knows everything about you.
Use an adblocker like ublock-origin if you don't want it.

All the code on this website is licensed under the GNU GPL v3 license
unless already licensed under a license which does not allows this form
of licensing or if another license is stated on that page / in that software:

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

Just to be clear, the information on this website is for meant for educational
purposes and you use it at your own risk. I do not take responsibility if you
screw something up. Use common sense, do not 'rm -rf /' as root for example.
If you have any questions then do not hesitate to contact me.

See https://raymii.org/s/static/About.html for details.