2021年2月4日 星期四

ExChange 春節期間調整信箱容量大小指令

 ExChange 春節期間調整信箱容量大小指令

提供指令如下
(黃框文字請自行修改)

1.     提供滙出所有信箱大小的指令,如提供的CSV檔。

匯出指令

Get-mailbox -ResultSize Unlimited | select Guid,Name,DisplayName,WindowsEmailAddress,IssueWarningquota,ProhibitSendQuota,ProhibitSendReceiveQuota,UseDatabaseQuotaDefaults | Export-CSV -path c:\temp\mailboxQuota-202102xx.csv -notypeinformation -Encoding UTF8

匯入指令

Import-Csv c:\temp\mailbox.csv | %{Set-Mailbox -Identity $_.Guid -IssueWarningquota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota -ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -UseDatabaseQuotaDefaults $false}

 

2.     設定一個人的信箱指令,還原的指令。

匯出指令

Get-mailbox -Identity Jason.wang@kgi.com | select Guid,Name,DisplayName,WindowsEmailAddress,IssueWarningquota,ProhibitSendQuota,ProhibitSendReceiveQuota,UseDatabaseQuotaDefaults | Export-CSV -path c:\temp\mailboxQuota-202102xx.csv -notypeinformation -Encoding UTF8

匯入指令

Import-Csv c:\temp\mailbox.csv | %{Set-Mailbox -Identity $_.Guid -IssueWarningquota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota -ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -UseDatabaseQuotaDefaults $false}

 

3.     設定一個資料庫的指令,還原的指令。

匯出指令

Get-mailbox -ResultSize Unlimited -Database exch01-db1 | select Guid,Name,DisplayName,WindowsEmailAddress,IssueWarningquota,ProhibitSendQuota,ProhibitSendReceiveQuota,UseDatabaseQuotaDefaults | Export-CSV -path c:\temp\mailboxQuota-202102xx.csv -notypeinformation -Encoding UTF8

匯入指令

Import-Csv c:\temp\mailbox.csv | %{Set-Mailbox -Identity $_.Guid -IssueWarningquota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota -ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -UseDatabaseQuotaDefaults $false}

 

4.設定一台主機的指令 ,還原的指令。

匯出指令

Get-mailbox -ResultSize Unlimited -Server scni-exch01 | select Guid,Name,DisplayName,WindowsEmailAddress,IssueWarningquota,ProhibitSendQuota,ProhibitSendReceiveQuota,UseDatabaseQuotaDefaults | Export-CSV -path c:\temp\mailboxQuota-202102xx.csv -notypeinformation -Encoding UTF8

匯入指令

Import-Csv c:\temp\mailbox.csv | %{Set-Mailbox -Identity $_.Guid -IssueWarningquota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota -ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -UseDatabaseQuotaDefaults $false}

 

5.設定台灣全部主機的指令,還原的指令。

匯出指令

Get-mailbox -ResultSize Unlimited | select Guid,Name,DisplayName,WindowsEmailAddress,IssueWarningquota,ProhibitSendQuota,ProhibitSendReceiveQuota,UseDatabaseQuotaDefaults | Export-CSV -path c:\temp\mailboxQuota-202102xx.csv -notypeinformation -Encoding UTF8

匯入指令

Import-Csv c:\temp\mailbox.csv | %{Set-Mailbox -Identity $_.Guid -IssueWarningquota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota -ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -UseDatabaseQuotaDefaults $false}





您好,

 

提供指令如下 (黃框文字請自行修改)

 

1.     提供滙出所有信箱大小的指令如提供的CSV

匯出指令

Get-mailbox -ResultSize Unlimited | select Guid,Name,DisplayName,WindowsEmailAddress,IssueWarningquota,ProhibitSendQuota,ProhibitSendReceiveQuota,UseDatabaseQuotaDefaults | Export-CSV -path c:\temp\mailboxQuota-202102xx.csv -notypeinformation -Encoding UTF8

 

2.     設定一個人的信箱指令還原的指令

設定指令

Set-Mailbox -Identity Jason.wang@kgi.com -UseDatabaseQuotaDefaults $true

還原指令

Set-Mailbox -Identity Jason.wang@kgi.com -UseDatabaseQuotaDefaults $false

 

3.     設定一個資料庫的指令還原的指令

設定指令

Set -MailboxDatabase -identity exch01-db1 -IssueWarningQuota 40GB -ProhibitSendQuota 45GB -ProhibitSendReceiveQuota 50GB

get-mailbox -ResultSize Unlimited -Database exch01-db1 | Set-Mailbox -UseDatabaseQuotaDefaults $true

還原指令

Set -MailboxDatabase -identity exch01-db1 -IssueWarningQuota 1.9GB -ProhibitSendQuota 2GB -ProhibitSendReceiveQuota 50GB

get-mailbox -ResultSize Unlimited -Database exch01-db1 | Set-Mailbox -UseDatabaseQuotaDefaults $ false

 

4.     設定一台主機的指令 還原的指令

設定指令

Get-MailboxDatabase -identity exch01* | Set-MailboxDatabase -IssueWarningQuota 40GB -ProhibitSendQuota 45GB -ProhibitSendReceiveQuota 50GB

get-mailbox -ResultSize Unlimited -Server scni-exch01 | Set-Mailbox -UseDatabaseQuotaDefaults $true

還原指令

Set -MailboxDatabase -identity exch01* -IssueWarningQuota 1.9GB -ProhibitSendQuota 2GB -ProhibitSendReceiveQuota 50GB

get-mailbox -ResultSize Unlimited -Server scni-exch01 | Set-Mailbox -UseDatabaseQuotaDefaults $false

 

5.     設定台灣全部主機的指令還原的指令

設定指令

Get-MailboxDatabase -identity ex* | Set-MailboxDatabase -IssueWarningQuota 40GB -ProhibitSendQuota 45GB -ProhibitSendReceiveQuota 50GB

get-mailbox -ResultSize Unlimited  | Set-Mailbox -UseDatabaseQuotaDefaults $true

還原指令

Set -MailboxDatabase -identity ex* -IssueWarningQuota 1.9GB -ProhibitSendQuota 2GB -ProhibitSendReceiveQuota 50GB

get-mailbox -ResultSize Unlimited | Set-Mailbox -UseDatabaseQuotaDefaults $false