Powershell Script or GPO to Reset OOO message count on Exchange 2010

I am looking for an PowerShell script or GPO that will disable the Out Of Office assistant or OOO and then re-enable it to clear the message count to external senders for Exchange 2010. This would need to be done on the exchange server itself. Can anyone help?
The-It-ProAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Showing for two mailboxes:
"identity1", "identity2" |
  Get-MailboxAutoReplyConfiguration | 
  ? { $_.AutoReplyState -ne 'Disabled' } |
  % {
    $ooo =  $_
    $ooo | Set-MailboxAutoReplyConfiguration -AutoReplyState Disabled
    $ooo | Set-MailboxAutoReplyConfiguration -AutoReplayState $ooo.AutoReplyState -StartTime $ooo.StartTime -EndTime $ooo.EndTime
  }

Open in new window

This can be changed easily to use get-mailbox instead of a list to go thru all mailboxes.
0
Will SzymkowskiSenior Solution ArchitectCommented:
I just want to point out that to use that script with that cmdlet you will need to be running atleast Exchange 2010 SP3.

Will.
0
The-It-ProAuthor Commented:
Thank you for the reply. Please clarify as to how I would use the above to disable all autoreply on the entire organisation iso per mailbox. I am not a expert on PowerShell and would prefer a gpo, but it seems like there is no such an option.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
No, a GPO is not appliable. It always runs either for a machine or user, with that scope. The Exchange Server does not use GPOs.

Do you want to go thru all mailboxes, and if OOO is active trigger the state? Or do you need a more restrictive filter (particular OU, for example)?
If all mailboxes shall be processed, just replace line 1 with
Get-MailBox -ResultSize Unlimited |

Open in new window

otherwise you need to set up e.g. the filter parameter of that cmdlet to your needs. For details see https://technet.microsoft.com/en-us/library/bb123685(v=exchg.141).aspx.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.