none
schedule recurring Out of Office RRS feed

  • Question

  • Hi All
    I want to schedule recurring out of office every day. i have shared mailbox and i want to set out of office for shared mailbox for every email which is received from 9PM to 6AM as the users who have access to this shard mailbox works from 6AM to 9PM.
    Is this possible to set on exchange as OWA is disabled in my environment. Please guide me on this
    Friday, August 9, 2019 6:04 PM

Answers

  • Hi,

     

    Based on your requirement, you could use built-in tool Task Scheduler combines with Set-MailboxAutoReplyConfigurationrun command.  Create two daily scheduled tasks, one for running the command on 9PM, another for disabling the command on next day 6AM. The detailed commands for your reference:

    Open Windows Power Shell with administrator privilege, then run the commands below:

    #Enable AutoReply

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:// <ServerFQDN > / PowerShell / -Authentication Kerberos

    Import-PSSession $ Session

     

    Set-MailboxAutoReplyConfiguration -AutoReplyState Enabled -Identity username@contoso.com -InternalMessage "Internal OOF message" -ExternalMessage "External OOF message"

     

    #Disable AutoReply

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:// <ServerFQDN > / PowerShell / -Authentication Kerberos

    Import-PSSession $ Session

     

    Set-MailboxAutoReplyConfiguration -AutoReplyState Disabled -Identity username@contoso.com

     

    Save them separately as .ps1 format. Then open Task Scheduler, configure two daily scheduled tasks.

     


    Notes: In the "General" tab, make sure that the checkbox "Run it with the highest privileges" is checked.

     

    For detailed steps of creating tasks, please refer to the article below:

     

    Configure to run a PowerShell Script into Task Scheduler

    https://social.technet.microsoft.com/wiki/contents/articles/38580.configure-to-run-a-powershell-script-into-task-scheduler.aspx

     

    Regards,

    Kelvin Deng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com



    • Proposed as answer by ThinkCenter Tuesday, August 13, 2019 2:36 AM
    • Edited by ThinkCenter Tuesday, August 13, 2019 9:37 AM
    • Marked as answer by Glenn Maxwell Tuesday, August 20, 2019 5:58 PM
    Monday, August 12, 2019 5:47 AM
  • Hi,

    as mentioned by Rhoderick many years ago, loading Exchange Snap-Ins is not supported. It also limits where the script can be run at to machines with Exchange Management Shell installed.

    The supported and more portable way is to use Remoting as described in the article.


    Evgenij Smirnov

    http://evgenij.smirnov.de

    • Marked as answer by Glenn Maxwell Tuesday, August 20, 2019 5:59 PM
    Monday, August 12, 2019 7:25 AM

All replies

  • Hi,

    you'll have to invoke a Set-MailboxAutoReplyConfiguration every day between 6AM and 9PM to activate OoO for the next period.


    Evgenij Smirnov

    http://evgenij.smirnov.de

    Saturday, August 10, 2019 11:26 AM
  • Is there no other way to set OOO since daily i have to set OOO, the requirement is set OOO daily from 9PM to 6AM.
    Saturday, August 10, 2019 12:59 PM
  • Hi,

     

    Based on your requirement, you could use built-in tool Task Scheduler combines with Set-MailboxAutoReplyConfigurationrun command.  Create two daily scheduled tasks, one for running the command on 9PM, another for disabling the command on next day 6AM. The detailed commands for your reference:

    Open Windows Power Shell with administrator privilege, then run the commands below:

    #Enable AutoReply

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:// <ServerFQDN > / PowerShell / -Authentication Kerberos

    Import-PSSession $ Session

     

    Set-MailboxAutoReplyConfiguration -AutoReplyState Enabled -Identity username@contoso.com -InternalMessage "Internal OOF message" -ExternalMessage "External OOF message"

     

    #Disable AutoReply

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:// <ServerFQDN > / PowerShell / -Authentication Kerberos

    Import-PSSession $ Session

     

    Set-MailboxAutoReplyConfiguration -AutoReplyState Disabled -Identity username@contoso.com

     

    Save them separately as .ps1 format. Then open Task Scheduler, configure two daily scheduled tasks.

     


    Notes: In the "General" tab, make sure that the checkbox "Run it with the highest privileges" is checked.

     

    For detailed steps of creating tasks, please refer to the article below:

     

    Configure to run a PowerShell Script into Task Scheduler

    https://social.technet.microsoft.com/wiki/contents/articles/38580.configure-to-run-a-powershell-script-into-task-scheduler.aspx

     

    Regards,

    Kelvin Deng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com



    • Proposed as answer by ThinkCenter Tuesday, August 13, 2019 2:36 AM
    • Edited by ThinkCenter Tuesday, August 13, 2019 9:37 AM
    • Marked as answer by Glenn Maxwell Tuesday, August 20, 2019 5:58 PM
    Monday, August 12, 2019 5:47 AM
  • Hi,

    as mentioned by Rhoderick many years ago, loading Exchange Snap-Ins is not supported. It also limits where the script can be run at to machines with Exchange Management Shell installed.

    The supported and more portable way is to use Remoting as described in the article.


    Evgenij Smirnov

    http://evgenij.smirnov.de

    • Marked as answer by Glenn Maxwell Tuesday, August 20, 2019 5:59 PM
    Monday, August 12, 2019 7:25 AM
  • Hi,

     

    I am writing here to confirm with you how the thing going now?

     

    If you need further help, please provide more detailed information, so that we can give more appropriate suggestions.

     

    Regards,

    Kelvin Deng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com


    Thursday, August 15, 2019 9:11 AM
  • Now there exists a tool Scheduled OOF for Office 365
    Wednesday, July 1, 2020 9:50 AM