How To Restrict The Times That Your Users Can Log Into Microsoft Exchange 2010 Outlook Web App.

Leave a comment
Share

An interesting question came up in one of the MSExchange.org forums recently. A guy simply wanted to limit the times that OWA was available to his users. There’s no built-in way to do this, but I was able to suggest a fairly simple modification to the FBA logon page (this won’t work if you don’t have FBA enabled).

First, look for the logon.aspx file in the C:\Program Files\Microsoft\Exchange Server\v14\ClientAccess\Owa\auth folder. Make a copy of it (important if something goes wrong), and then open it in Notepad. Look near the beginning for a line like this:

    <% if (!ReplaceCurrent) { %>

Just before it, insert the following code:

    <%
    int h = DateTime.Now.Hour;
    if(h < 9 || h > 17)
    {
      Response.Write("Sorry, OWA is only available between 09:00 and 18:00");
      Response.End();
    }
    %>

This will prevent anyone logging into OWA outside the hours of 09:00 and 18:00. Unfortunately, it won’t kick out anyone who is already logged in; but maybe one day I’ll look at the Default.aspx file, and see if something can be added there.

As with most of these type of modifications, you will need to check that they still function after each product update. Sometimes your modified file will be replaced by a new one from the update.





Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>