1) Create a folder on your Exchange server. For Example, C:\ExchangeOOOReset.
2) Open Notepad and enter the following-
$enabled = get-mailbox -resultsize unlimited |get-mailboxautoreplyconfiguration | where {$_.autoreplystate -eq "enabled"} | select identity,autoreplystate
$enabled | foreach-object {
set-mailboxautoreplyconfiguration $_.identity -autoreplystate "Disabled"
set-mailboxautoreplyconfiguration $_.identity -autoreplystate $_.autoreplystate
}
3) Save the file as OOOReset.ps1, save it in C:\ExchangeOOOReset. Make sure you select "All Files" so it doesn't add .txt to the files.
4) Open Task Scheduler, click Create Basic Task.
5) Name it, ExchangeOOO, click Next, Next, select the time of day it should reset, Next, Start a Program.
6) Under Program/Script-
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
7) Under Add Arguements-
-NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; C:\ExchangeOOReset\oooreset.ps1"
That's it!
No comments:
Post a Comment