Finding Users Who Have “Out Of Office” Enabled In Exchange 2010…

Share & Comment

It might come in handy if you know how to get a list of users who have out of office message turned on. Exchange 2010 shell gives you that ability now.

You can even change the message, set the audience (internal or external), turn it off etc with the shell.

To get a list of users who have out of office scheduled, run the following command.

Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object { $_.AutoReplyState –eq “scheduled” }

The above command gives you much more than you need, including the actual message, start time, end time etc.

If you are only interested in the list of users, run

Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object { $_.AutoReplyState –eq “scheduled” } | fl identity

Find USers with oof scheduled

If you want to get the settings for a particular user (for example Rajith), run

Get-MailboxAutoReplyConfiguration –identity rajith

You can also change the out of office settings for a particular user with the Set-MailboxAutoReplyConfiguration cmdlet.

For example, to turn off the out of office for the user account “Rajith”, run

Set-MailboxAutoReplyConfiguration –identity “Rajith” –AutoreplyState disabled

Disable autoreply

Similarly, if you want to extend the out of office message for a user (change the end time), run

Set-MailboxAutoReplyConfiguration –identity “Rajith” –EndTime 01/12/2009 17:00:00

You can change the actual out of office message (internal and external) by running

Set-MailboxAutoReplyConfiguration –identity “Rajith” –InternalMessage “I won’t be around today guys” –ExternalMessage “I am out of the office today”

Do note that this cmdlets will only work in Exchange 2010 Shell!

Share & Comment
Subscribe for Updates
Never miss a blog post again

23 comments… add one

  1. Anonymous

    Very cool.. really enjoy your blogs, thanks Liam

  2. Thanks Liam.

  3. Thanks Sh-eli.

  4. Anonymous

    Hi does anyone know how to get all the mailboxes with OOF enabled, disable it, then re-enable it for those same users?

    The reason is I want to run it at midnight each night as a scheduled task to reset the 'sent to' list. I have a lot of requests to sent OOF once per day per sender, instead of once per OOF period.

    I need some help piping this together

    Get this and store in variable
    Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object { $_.AutoReplyState –eq “scheduled”

    Then do this
    Set-MailboxAutoReplyConfiguration –AutoreplyState disabled

    Then do this
    Set-MailboxAutoReplyConfiguration –AutoreplyState enabled

  5. Anonymous

    Thanks for posting the article.
    I think it should be 'Enabled' instead of 'Scheduled'

    Where-Object { $_.AutoReplyState –eq “Enabled” }

  6. Anonymous

    Thanks for the post it really helped

  7. Thanks Anonymous.

  8. Michael

    It would be nice to block OOF messages by Organization Units. We have an “OldEmployees” OU that we move old employees to until we archive their messages.

    1. Rajith Enchiparambil

      Good thought Michael.

  9. Oscar

    This is some ‘Kung Fu’. Thanks so much, searched everywhere on how to set a users out of office assistant while they are already gone! And this worked like a charm. The only thing I couldn’t get shell to accept, was the time. So I just set the date for one day later for their return. Any ideas on why the time failed?

    1. Rajith Enchiparambil

      Hi Oscar,

      Are you using the correct time format? Say if the user has their mailbox regional settings set to GMT & if you configure the time in US format, it won’t take it.

  10. The correct command would be
    Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object { $_.AutoReplyState -ne “disabled” }
    because state can be enabled or scheduled.

    1. Thanks Rauno. I think “enabled” and “scheduled” will be the same anyway. Yes, you can use -ne disabled to be on the same side ;)

      1. Fredrik

        Actually using -eq “scheduled” or “enabled” gives different results.
        with -ne “disabled” you will get all users.

        scheduled = users with an end date for reply message
        enabled = users with no end date for reply message.

        1. Rajith Jose Enchiparambil

          Thanks Fredrik.

  11. Prasanna Shroti

    Hi, thanks a lot for the useful information. Is there a way to find out this information programatically, through a Webservices or an RMI call etc. We need this information for one implementation.

  12. blair

    awesome!!

    1. Rajith Jose Enchiparambil

      Thanks Blair.

  13. Amoz

    Brilliant just what i needed, thanks.

    Re: Set-MailboxAutoReplyConfiguration –identity “Rajith” –EndTime 01/12/2009 17:00:00

    I found that date had to be in US format, i.e mm/dd/yyyy and for time to work as well it needs to be in double quotes, i.e.
    Set-MailboxAutoReplyConfiguration –identity “Rajith” –EndTime “01/12/2009 17:00:00″

    1. Yes Amoz, the date has to be in US format. I believe I wrote about it in another post.

      Thanks

  14. HeyAdmin

    I would like to run a scheduled task in the context of an account that has the minimum necessary exchange permissions to query all the recipients in our enterprise using get-mailboxautoreplyconfiguration. Does anyone know the minimum necessary permissions so that I can get the exchange administrators to approve my request?

    1. You should be asking the Exchange guys to give you the necessary permissions, which will involve playing with RBAC.

Leave a Comment