Forum Discussion
Setup Auto Reply from email addresses
- Aug 29, 2016
You can use the below script to get this done.
$NewdomainName="@xyz.com" $Mailboxs=get-mailbox -resultsize unlimited | Where { $_.RecipientTypeDetails -eq ‘LegacyMailbox’ } Foreach($Mailbox in $mailboxs) { $Message="email address no more exist please send email to"+$Mailbox.Alias+$NewdomainName Set-MailboxAutoReplyConfiguration -Identity $Mailbox.Identity -AutoReplyState scheduled -InternalMessage $Message -ExternalMessage $Message }
- DeletedAug 29, 2016
Thanks Dan.
But that will not work as we need to give the senders the correct email address as well while replying back :)
- SanthoshB1Aug 29, 2016Bronze Contributor
You can use the below script to get this done.
$NewdomainName="@xyz.com" $Mailboxs=get-mailbox -resultsize unlimited | Where { $_.RecipientTypeDetails -eq ‘LegacyMailbox’ } Foreach($Mailbox in $mailboxs) { $Message="email address no more exist please send email to"+$Mailbox.Alias+$NewdomainName Set-MailboxAutoReplyConfiguration -Identity $Mailbox.Identity -AutoReplyState scheduled -InternalMessage $Message -ExternalMessage $Message }
- Abdullah Tahir khanFeb 17, 2021Copper Contributor
HI Santhosh, I saw your script of Autoreply, It is simple and time saving, appreciated. However, I have a question, Can this script be customized to take input from csv file? e.g. I create a csv file and in one column I put old email address and 2nd column I put new email address and auto reply would state that " Dear Sender, please note that email ID of OLD email address has been changed to NEW email address" and script will run for all users in this CSV file.
Looking forward your assistance. Thanks in advance. Your old script is as below;
_________________________________________________________
$NewdomainName="@xyz.com"
$Mailboxs=get-mailbox -resultsize unlimited | Where { $_.RecipientTypeDetails -eq ‘LegacyMailbox’ }
Foreach($Mailbox in $mailboxs)
{
$Message="email address no more exist please send email to"+$Mailbox.Alias+$NewdomainName
Set-MailboxAutoReplyConfiguration -Identity $Mailbox.Identity -AutoReplyState scheduled -InternalMessage $Message -ExternalMessage $Message
}
_________________________________________________________