office 365 out of office powershell

Does anyone know the powershell commands to turn off out of office replies on all users.
office 365
WIZU2Asked:
Who is Participating?
 
Raheman M. AbdulConnect With a Mentor Senior Infrastructure Support Analyst & Systems DeveloperCommented:
Try:

Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') | Set-MailboxAutoReplyConfiguration  –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
For one user:

Set-MailboxAutoReplyConfiguration -Identity mailboxname@company.com –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null
0
 
WIZU2Author Commented:
How can I do the whole company at once? I setup up OOF reply during a migration for everyone now I need to take it off.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
WIZU2Author Commented:
I ran it and it did something. The below is displayed

PS Z:\> Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') | Set-MailboxAutoReplyConfig
uration  -AutoReplyState Disabled -ExternalMessage $null -InternalMessage $null
>>
The cursor is just blinking next to the >>
Is it waiting for more input?

Thanks for your help!!
0
 
WIZU2Author Commented:
I didn't get any error though.
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Are you running this on the same server where exchange mailboxes exists?

Try this first:

Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox')

let me know the outcome
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
I have tried for around 10 mailboxes and got the results working. I guess you have too many mailboxes and is the reason for the delay.

Try:
Get-Mailbox -ResultSize 5 -Filter {(RecipientTypeDetails -eq 'UserMailbox')

then Try :
Get-Mailbox -ResultSize 5 -Filter {(RecipientTypeDetails -eq 'UserMailbox') | Set-MailboxAutoReplyConfiguration  –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null

we just take 5 mailboxes and see how it goes.
0
 
WIZU2Author Commented:
No I am connecting remotely. When I run the above it goes to the

>>  with a blinking cursor. Am I using wrong powershell?
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Try this and see :

To list all the mailboxes and their autoreplystate :

get-mailbox | Get-MailboxAutoReplyConfiguration | select mailboxownerid, Autoreplystate
0
 
WIZU2Author Commented:
It came back with a list of all the mailboxes, some show enabled, some are disabled. Maybe I didn't let the run long enough. There are over 100 mailboxes.
0
 
WIZU2Author Commented:
Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') | Set-MailboxAutoReplyConfiguration  –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null



$UserAccounts = Get-Mailbox -ResultSize Unlimited
ForEach ($user in $UserAccounts)
{
Set-MailboxAutoReplyConfiguration $user.name –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null;
}
0
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.

All Courses

From novice to tech pro — start learning today.