Skip to main content

Raymii.org Raymii.org Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed

Exchange 2010 - OWA - Lock user after x amount of failed logins

Published: 19-12-2012 | Author: Remy van Elst | Text only version of this article


❗ This post is over eleven years old. It may no longer be up to date. Opinions may have changed.


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.

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:

I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $200 credit for 60 days. Spend $25 after your credit expires and I'll get $25!

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) and this one.

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.)

Tags: exchange , microsoft , outlook , outlook-web-access , owa , server-2008 , tutorials , windows