Error when trying to run "Set-MailboxAutoReplyConfiguration"

Sean 0 Reputation points
2024-05-01T21:27:42.6266667+00:00

Trying to create a script that will set the auto-response for all disabled users but I am getting an error on the Set-MailboxAutoReplyConfiguration command.

I have tried it in both Powershell and Exchange Management Shell.

I have tried different variables for the identity and all give the same error.

Running this on the local Exchange Server - Exchange Server 2019 CU14 (2024H1)

Any help would be greatly appreciated.

Set-MailboxAutoReplyConfiguration xxx@abc.com -AutoReplyState Enabled -ExternalAudience All -InternalMessage 'xxx message xxx' -ExternalMessage 'xxx message xxx'

Write-ErrorMessage : |Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException|The operation couldn't be performed because Identity:"xxx@abc.com" couldn't be found.

At C:\Users\administrator.abc.com\AppData\Local\Temp\tmpEXO_chzfs0kz.lqy\tmpEXO_chzfs0kz.lqy.psm1:1191 char:13

Write-ErrorMessage $ErrorObject


CategoryInfo          : NotSpecified: (:) [Set-MailboxAutoReplyConfiguration], ManagementObjectNotFoundException

FullyQualifiedErrorId : [Server=SN4PR22MB3221,RequestId=3de98cea-361c-2496-33d1-af1ffacf12a1,TimeStamp=Wed, 01 May 2024 21:15:49 GMT],Write-ErrorMessage

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
3,934 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,386 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Andy David - MVP 142.7K Reputation points MVP
    2024-05-01T21:34:17.2866667+00:00

    Try a get then a set. Example:

    Get-MailboxAutoReplyConfiguration <id> | Set-MailboxAutoReplyConfiguration etc...
    
    0 comments No comments

  2. Sean 0 Reputation points
    2024-05-01T21:46:51.4566667+00:00

    Damm, got the same error, even with just the Get-MailboxAutoReplyConfiguration command.

    0 comments No comments

  3. Andy David - MVP 142.7K Reputation points MVP
    2024-05-01T22:02:22.89+00:00

    Where are you running these commands? They have to be run against where the mailbox is.

    It appears you are running against Exchange Online, not on-prem.

    Server=SN4PR22MB3221

    Where do the mailboxes live?