Difference between revisions of "Exchange Powershell Administration Commands"

From DFWLPiki
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Exchange]]
 
[[Category:Exchange]]
 +
Start all Exchange services after a problematic reboot
 +
Get-Service *Exchange* -Exclude *POP*,*IMAP*,*Hyper-V* | Start-Service
 +
After removing a node from a DAG, sometimes the cluster objects are still hanging around in server manager even though they are already decommissioned or deleted
 +
cluster node SERVERNAME /forcecleanup
 
Uninstall Exchange on Windows Server Core
 
Uninstall Exchange on Windows Server Core
 
  cd 'C:\Program Files\Microsoft\Exchange Server\V15\Bin\'
 
  cd 'C:\Program Files\Microsoft\Exchange Server\V15\Bin\'
Line 5: Line 9:
 
Node complains that is still a member of a DAG during uninstall
 
Node complains that is still a member of a DAG during uninstall
 
  Clear-ClusterNode HOSTNAME  
 
  Clear-ClusterNode HOSTNAME  
 
'''Exchange 2013'''<br>
 
  
 
Database Management
 
Database Management
Line 15: Line 17:
 
  Get-ExchangeServer|Format-List name, edition, admindisplayversion, serverrole, site
 
  Get-ExchangeServer|Format-List name, edition, admindisplayversion, serverrole, site
  
 
Check and disable backscatter:
 
Get-RemoteDomain | select identity, DeliveryReportEnabled
 
Get-RemoteDomain | select identity, NDREnabled
 
 
Set-RemoteDomain -Identity * -NDREnabled $false
 
Set-RemoteDomain -Identity * -DeliveryReportEnabled $false
 
 
Check Exchange Server Version:
 
Get-ExchangeServer|Format-List name, edition, admindisplayversion, serverrole, site
 
 
and source link for what different versions numbers are:
 
and source link for what different versions numbers are:
 
  http://technet.microsoft.com/en-us/library/hh135098(v=exchg.150).aspx
 
  http://technet.microsoft.com/en-us/library/hh135098(v=exchg.150).aspx
Line 30: Line 22:
 
Show all mailboxes and their current size and usage status:
 
Show all mailboxes and their current size and usage status:
 
  Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto
 
  Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto
 +
Or same thing, but Exchange 2019
 +
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize

Latest revision as of 11:08, 17 June 2021

Start all Exchange services after a problematic reboot

Get-Service *Exchange* -Exclude *POP*,*IMAP*,*Hyper-V* | Start-Service

After removing a node from a DAG, sometimes the cluster objects are still hanging around in server manager even though they are already decommissioned or deleted

cluster node SERVERNAME /forcecleanup

Uninstall Exchange on Windows Server Core

cd 'C:\Program Files\Microsoft\Exchange Server\V15\Bin\'
exsetupui.exe -mode:uninstall

Node complains that is still a member of a DAG during uninstall

Clear-ClusterNode HOSTNAME 

Database Management

Get-MailboxDatabaseCopyStatus * | ft -auto
Get-MailboxDatabaseCopyStatus * -Active | Select Name,Status,MailboxServer,ActivationPreference,ContentIndexState

Display current running exchange version on all servers:

Get-ExchangeServer|Format-List name, edition, admindisplayversion, serverrole, site

and source link for what different versions numbers are:

http://technet.microsoft.com/en-us/library/hh135098(v=exchg.150).aspx

Show all mailboxes and their current size and usage status:

Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto

Or same thing, but Exchange 2019

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize