Greetings,
I've been working on trying to add a particular domain and e-mail to my organization's Safe Senders list for everyone to show up in their Outlook junk email options settings. I can configure for a user with the below command but trying to remove will throw an unusual error. This doesn't happen to all users just some so not sure what's the common denominator here. Can someone please provide some insight and a solution? Thanks in advance for your feedback!
Add trusted domain and e-mail -- this is working in adding the values in Outlook for all user
Set-MailboxJunkEmailConfiguration -Identity john.doe@Company portal .com -TrustedSendersAndDomains @{Add="trust.domain.com","no-reply@trust .domain.com"}
Remove trusted domain and e-mail --- this is failing trying to remove the value in Outlook for some users
Set-MailboxJunkEmailConfiguration -Identity john.doe@Company portal .com -TrustedSendersAndDomains @{Remove="trust.domain.com","no-reply@trust .domain.com"}
Error:
Write-ErrorMessage : |Microsoft.Exchange.Configuration.CmdletProxyException|Error on proxy command 'Set-MailboxJunkEmailConfiguration -Identity:'john.doe@Company portal .com' -TrustedSendersAndDomains:@{'Remove' = 'trust.domain.com'; '-' = 'no-reply@trust .domain.com'} -Confirm:$False' to server DM6PR01MB5611.prod.exchangelabs.com: Server
version 15.01.0000.0000, Proxy method PSWS:
BadRequest: Invalid Operation : {
"code": "BadRequest",
"message": "Invalid Operation",
"innererror": {
"message": "Invalid Operation",
"type": "Microsoft.Exchange.Admin.OData.Core.ODataServiceException",
"stacktrace": " at Microsoft.Exchange.AdminApi.CommandInvocation.CommandInvocation.InvokeCommand(QueryContext queryContext, CmdletInvokeInputType cmdletInvokeInputType)\r\n at Microsoft.Exchange.Admin.OData.Core.PathSegmentToExpressionTranslator.Translate(OperationImportSegment segment)\r\n at
Microsoft.Exchange.Admin.OData.Core.QueryContext.ResolveQuery(ODataContext context, Int32 level)\r\n at Microsoft.Exchange.Admin.OData.Core.Handlers.OperationHandler.Process(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage)\r\n at Microsoft.Exchange.Admin.OData.Core.Handlers.RequestHandler.Process(Stream
requestStream)",
"internalexception": {
"message": "Cannot process argument transformation on parameter 'TrustedSendersAndDomains'. Cannot convert value \"System.Collections.Generic.Dictionary2[System.String,System.Object]\" to type \"Microsoft.Exchange.Data.MultiValuedProperty
1[System.String]\". Error: \"MultiValuedProperty collections cannot contain null
values.\r\nParameter name: item\"",
"type": "Microsoft.Exchange.AdminApi.CommandInvocation.ParameterTransformationException",
"stacktrace": ""
}
}
} [Server=GVXP194MB1808,RequestId=326cf62d-f324-e276-19d6-bc9e7f684b8b,TimeStamp=11/23/2022 8:39:19 PM] .
At C:\Users\vly\AppData\Local\Temp\tmpEXO_ab2delz0.rbx\tmpEXO_ab2delz0.rbx.psm1:1097 char:13
- Write-ErrorMessage $ErrorObject
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Set-MailboxJunkEmailConfiguration], CmdletProxyException
- FullyQualifiedErrorId : [Server=GVXP194MB1808,RequestId=326cf62d-f324-e276-19d6-bc9e7f684b8b,TimeStamp=Wed, 23 Nov 2022 20:39:18 GMT],Write-ErrorMessage
My Outlook comes with these default Safe Senders and I'm not sure where this is coming from. If I can figure out where this is configured, it would be better to just add my list to this vs Exchange PS method.
defender-noreply@microsoft.com
microsoft-noreply@microsoft.com
noreply@emeaemail.teams.microsoft.com
o365sup2@microsoft.com