我制作了此脚本,以将一些电子邮件放入“类别”中。它在电子邮件和messageID处显示。
但是我误会了
使用此插件:https://www.powershellgallery.com/packages/Exch-Rest/3.6
脚本:
$messages = Import-Csv -Path c:\temp\123.csv
Connect-EXRMailbox -Mailbox "DOP@test.com"
ForEach ($message in $messages){
$MessageId = $message.messageID
$MailboxName = $message.Email
$Item = Find-EXRMessageFromMessageId -MailboxName $MailboxName -MessageId $MessageId
Set-EXRItemCategory -MailboxName $MailboxName -Item $Item -Categories @("red")
}
CSV:
"messageID","Email"
"HE1P192MB00423281AEEA3C8F5EC4CC20D1D80@HE1P192MB0042.EURP192.PROD.OUTLOOK.COM;testmail@test.com"