1、Exchange Powershell 识别Exchange命令
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Snapin;
2、查看邮件日志
Get-TransportService | Get-MessageTrackingLog -Sender "AAA" -MessageSubject "TEST" -Start "10/29/2022 00:00" -End "10/29/2022 23:59" -ResultSize Unlimited | Export-CSV "C:\\temp\\trace2.csv" -NoTypeInformation -Encoding UTF8
Get-TransportService | Get-MessageTrackingLog -Sender chenhengbiao1@abc.com -Recipients aaa@.cad.com -MessageSubject "test"|fl
3、exchange 导入证书
Import-ExchangeCertificate -FileData ([System.IO.File]::ReadAllBytes('\\\\FileServer01\\Data\\Fabrikam.pfx')) -Password *(ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force)
*Get-ExchangeCertificate | where {$_.Status -eq "Valid"} | Format-List FriendlyName,Subject,CertificateDomains,Thumbprint,NotBefore,NotAfter*
4、邮箱账号重新连接到新域账号*
ecp 上禁用邮箱
验证用户账户连接到的已删除邮箱是否存在于邮箱数据库中
$dbs = Get-MailboxDatabase
$dbs | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisplayName -eq "aaa"} | Format-List DisplayName,Database,DisconnectReason
将邮箱连接到AD用户账户
Connect-Mailbox -Identity "aaa" -Database SZ-DB-AA -User "aaa"
5、统计邮箱收发数量
收
Get-ExchangeServer sz-exs-* | Get-MessageTrackingLog -Start "2/23/2023 00:00:00" -end "2/24/2023 23:59:59" -EventId send -Recipients "fuhp@tcl.com" | Measure-object
发
Get-ExchangeServer sz-exs-* | Get-MessageTrackingLog -ResultSize unlimited -Start "2/21/2023 00:00:00" -end "2/23/2023 23:59:59"-EventId "send" -Sender "chenhengbiao1@abc.com" |Group-Object -Property sender | select Name,count |Export-CSV "C:\\temp\\SendmailG.csv" -NoTypeInformation -Append -Encoding UTF8
6、手动更新照片
Set-UserPhoto -Identity "aaa" -PictureData ([System.IO.File]::ReadAllBytes("D:\\107.jpg")) -Confirm
7、查看Exchange服务器对应的域控服务器
Get-ExchangeServer -Status -Identity exchange01 |fl name,*domain*
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞0
添加新评论0 条评论