2019年5月7日

Exchange Management Shell筆記

Get-MailboxDatabase | fl Identity,JournalRecipient
Get-MailboxDatabase | select name, JournalRecipient
Set-MailboxDatabase "Sales Database" -JournalRecipient "Sales Database Journal Mailbox"
 
Get-MailboxDatabase | fl Name,EdbFilePath,LogFolderPath

Get-ExchangeServer | Format-List Name, Edition, AdminDisplayVersion

1. 檢查DB是否開啟循環記錄,未開啟交易紀錄不會刪除  需卸載再裝載才會生效

Get-MailboxDatabase | select name, circularloggingenabled | sort circularloggingenabled -desc | ft -AutoSize


2. 新增DB,將使用者移到新DB
Get-Mailbox -Database "YD-DB02" -ResultSize Unlimited | New-MoveRequest -TargetDatabase "YD-DB03" 
 
Get-MoveRequestStatistics -MoveRequestQueue "MBXDB02" 

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

列出DB Size, Free Space, User Count
 
Get-MailboxDatabase -Status | select Name,@{Label="Free Space";Expression={$_.AvailableNewMailboxSpace.ToGB()}},@{Label="Size";Expression={$_.DatabaseSize.ToGB()}},@{Name="NumberofUsers";Expression={(Get-Mailbox -resultsize unlimited -Database $_.name).Count}} | ft -auto
 
Get-MailboxDatabase|FL name,*public*
 
 
 
 
get-exchangeserver

Export-Csv d:\temp\11.csv -NoTypeInformation -Encoding UTF8


檢查DB空白區

Get-MailboxDatabase -status | select Name,DatabaseSize,AvailableNewMailboxSpace













 
Get-MailboxDatabase -Server TCI-HQ-MBX01 | Set-MailboxDatabase -JournalRecipient "internalhq"
Get-MailboxDatabase -Server TCI-HQ-MBX02 | Set-MailboxDatabase -JournalRecipient "internalhq"
Get-MailboxDatabase -Server HPPI-MAIL | Set-MailboxDatabase -JournalRecipient "internalhq"
Get-MailboxDatabase -Server NTCI-MAIL01 | Set-MailboxDatabase -JournalRecipient "internal"
Get-MailboxDatabase -Server TCI-HQ-MBX03 | Set-MailboxDatabase -JournalRecipient "internalhq"
Get-MailboxDatabase -Server J-MAIL | Set-MailboxDatabase -JournalRecipient "internal"
Get-MailboxDatabase -Server G-MAIL | Set-MailboxDatabase -JournalRecipient "internal"
Get-MailboxDatabase -Server Y-MAIL | Set-MailboxDatabase -JournalRecipient "internal" 
 
 
Name                                    Server                                  JournalRecipient                       
----                                    ------                                  ----------------                       
HQ-TCI                                 TCI-HQ-MBX01                            taicement.com/Users/internalhq      
HQ-TCI-01                               TCI-HQ-MBX01                                                                 
 




get-mailboxserver |get-logonstatistics | select username,applicationid,clientversion,lastaccesstime |export-CSV D:\TEMP\LASTACCESS.CSV
 
想要在多個資料庫和伺服器輕易套用已刪除郵件的保留限制嗎? 試試下列命令來設定指定的伺服器上所有資料庫的已刪除郵件保留設定
:

 Get-MailboxDatabase -Server  | Set-MailboxDatabase -DeletedItemRetention 45.00:00:00

您也可以將相同的已刪除郵件保留限制或信箱保留限制套用於組織內的所有伺服器:

 Get-MailboxDatabase | Set-MailboxDatabase -DeletedItemRetention 45.00:00:00 -MailboxRetention 120.00:00:00 

沒有留言:

張貼留言

追蹤者