Hi
Is it possible to reset Out of Office through PowerShell so that it will return the OOF reply every day?
Lasse
Technology Tips and News
Hi
Is it possible to reset Out of Office through PowerShell so that it will return the OOF reply every day?
Lasse
Hi Lasse
You can set the OOF via Powershell, see the links below for exmaples of howto:
http://www.mikepfeiffer.net/2010/07/manage-exchange-2007-out-of-office-oof-settings-with-powershell-and-the-ews-managed-api/
http://gsexdev.blogspot.com/2009/08/setting-out-of-office-oof-with.html
http://www.powergui.org/thread.jspa?threadID=10736
BR
Mads
Hi
Is it possible to reset Out of Office through PowerShell so that it will return the OOF reply every day?
thanks for the clarification
Hi LasseF,
As above said, OOF only reply for the same user once unless you turn it off and turn it on per day.
If you really need to do this, you can write a PowerShell script of turn off\on the OOF and schedule it to run once every day :)
Here is a similar thread, but I don't test the script in it, you can have a try.
Hi Mads
I have added the EWS Managed API and can now use the Get-MailboxAutoReplyConfiguration and Set-MailboxAutoReplyConfiguration. I have run the following:
Get-Mailbox | Get-EWSOofSettings | ?{$_.state -eq "Enabled"} | select identity, state
I get the users with OOF enabled but I also get quite alot of these:
Exception calling "GetUserOofSettings" with "1" argument(s): "Microsoft.Exchang
e.Data.Storage.AccessDeniedException: User is not mailbox owner. User = S-1-5-2
1-725345543-1284227242-682003330-500, MailboxGuid = S-1-5-21-725345543-12842272
42-682003330-3619 ---> User is not mailbox owner. User = S-1-5-21-725345543-128
4227242-682003330-500, MailboxGuid = S-1-5-21-725345543-1284227242-682003330-36
19"
At line:23 char:43
+ $oof = $service.GetUserOofSettings <<<< ($PrimarySmtpAddress)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I have tried looking up the GUID, but it doesn't seem to belong to a user?
As far as I can see the above error message doesn't do anything. I get the list with the users that have OOF enabled.
Now I need to make a PS script that will check which users have OOF enabled and then disable it and enable it, but can't quit figure out how to do it yet, but I am sure that I will find a solution :-)
Hi LasseF,
Thanks for your update. I have a test on the script in the link and it works. After I run the ps script, I can receive the OOF reply again. You can have a try.
Here is the script:
$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 }
Hi Jack,
I found the solution yesterday. We are running Exchange 2007 SP3 so had to install the EWS API and add the function Get-EWSOofSettings. It works, but I still get the error messages that I posted earlier. I was just worried that I was missing some users with OOF enabled.
$enabled = get-mailbox -resultsize unlimited | Get-EWSOofSettings | where {$_.state -eq "Enabled"} | select identity,state $enabled | foreach-object { Set-EWSOofSettings -Identity $_.identity -State disabled Set-EWSOofSettings -Identity $_.identity -State enabled }
hi
i am getting the same error
Exception calling "GetUserOofSettings" with "1" argument(s): "Microsoft.Exchange.Data.Storage.AccessDeniedException: Us
er is not mailbox owner. User = S-1-5-21-2573305727-3136801584-897811289-5767, MailboxGuid = S-1-5-21-2573305727-313680
1584-897811289-4798 ---> User is not mailbox owner. User = S-1-5-21-2573305727-3136801584-897811289-5767, MailboxGuid =
S-1-5-21-2573305727-3136801584-897811289-4798"
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\profile.ps1:1014 char:39
+ $oof = $service.GetUserOofSettings <<<< ($Identity);
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
i am exchange admin
we have exchange 2007 sp3 RU 5
I would like to reset the out of office for a single mailbox or a couple of team mailboxes.
Can you help?
We have some team mailboxes that they want to automaticly reply to every email so our clients know we recieved their email.
I am concerned that if we setup automatic replys we could cause a auto-reply storm.
I would think OOO would work but it would need to be reset daily.
We have an HA system (Casarray's and Mailbox Arrays) with mulitple locations and multiple Mailbox servers. Would I need to run the script on all the Mailbox servers.
Also if you use the exception "except if it is an automatic reply"in an auto-reply rule will that ignore NDR?
Thanks,
Barry
Hi Barry
It shouldn't matter that you have multiple mailbox servers.
You wrote that you needed auto reply to every mail from your clients, then a daily reset of the OOF won't solve the issue?
I would look at creating a server rule on each mailbox, that responds to received mails and sends back an "auto" reply with the exception "except if it is an automatic reply".
Lasse