当我们在 Exchange Online 中创建公用文件夹并启用邮件时,默认电子邮件地址是 @domain.onmicrosoft.com
我们的文件夹名称是“NNNNN_Folder name”,其中 NNNNN 是一个 5 位数字。
我想将公用文件夹的主电子邮件地址设置为 NNNNN@domain.com
我已经尝试了很多变体:
Get-PublicFolder -Recurse -Identity "\X\Y\Z"|
Sort-Object Identity –Descending|
Select-Object -first 4|
Set-MailPublicFolder -PrimarySmtpAddress {$_.name.substring(0,5)+"@domain.com"}
并收到有关解释生成的电子邮件地址的错误:
Cannot process argument transformation on parameter 'PrimarySmtpAddress'. Cannot convert value
"$_.name.substring(0,5)+"@domain.com"" to type "Microsoft.Exchange.Data.SmtpAddress". Error: "The email
address "$_.name.substring(0,5)+"@domain.com"" isn't correct. Please use this format: user name, the @ sign,
followed by the domain name. For example, tonysmith@contoso.com or tony.smith@contoso.com."
+ CategoryInfo : InvalidData: (:) [Set-MailPublicFolder], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-MailPublicFolder
+ PSComputerName : outlook.office365.com
我还尝试在同一操作中将 PublicFolder 的 EmailAddress 设置为 NNNNN@domain.com。
-EmailAddresses @{$_.name.substring(0,5)+"@domain.com"}
它似乎没有在评估论点还是我错过了其他东西?
如果我Set-MailPublicFolder ...
改变
% {$_.name.substring(0,5) + "@domain.com"}
我确实看到了我期望的电子邮件地址。谢谢,
克雷格。