Exchange Powershell
Exchange Powershell
Exchange Powershell
$Credentials = Get-Credential
Import-PSSession $Session
Remove-PSSession $Session
=============================================================
### Examples of Exchange Management Shell ###
=============================================================
Get-MailboxDatabase
New-MailboxDatabase -Name DB5 -Server exchange.tshoot.com
=============================================================
### configure circular logging for a database ###
Set-MailboxDatabase DB2 -CircularLoggingEnabled $True
Set-MailboxDatabase DB2 -CircularLoggingEnabled $False
=============================================================
### Enable a user mailbox ###
Enable-Mailbox -Identity abeer -database DB2
=============================================================
Get-PublicFolder -Recurse
Get-PublicFolder -Recurse | FL
New-PublicFolder -Name Department -Path \ -Mailbox PFDB
>> Where PFDB is the name of the public folder mailbox
=============================================================
Get-OfflineAddressBook
New-OfflineAddressBook -name "Sales OAB" -AddressLists "Sales_Department"
Get-OfflineAddressBook | FL Name,Schedule
Get-OfflineAddressBook "Sales OAB" | Update-OfflineAddressBook
Get-OfflineAddressBook "Sales OAB" | FL Name,Lasttouch*
=============================================================
=============================================================
=============================================================
### Database Powershell Commands ###
Get-Command *-mailboxdatabase (Get a list of command that includes
mailboxdatabase)
New-MailboxDatabase -Server mail -name DB1
Get-MailboxDatabase DB1 | FL Name,ProhibitSendReceiveQuota
Get-MailboxDatabaseCopyStatus -Server mail
Set-MailboxDatabase DB1 -ProhibitSendReceiveQuota 20GB
Mount-Database DBA
Invoke-Command {Restart-Service MSExchangeIS -PassThru} -Comp mail
=============================================================
"DB1","DB2" | % {
New-MailboxDatabase -Server mail -Name $_
Mount-Database $_
}
Invoke-Command {Restart-Service MSExchangeIS -PassThru} -Comp mail
============================================================
Test-ReplicationHealth
Get-MailboxDatabaseCopyStatus -Server mail
Test-ServiceHealth
c:\Program Files\Microsoft\Exchange
Server\V15\Scripts\./CheckDatabaseRedundancy.ps1 -MailboxDatabaseName "DB1"
=============================================================
=============================================================
=============================================================
Get-OrganizationConfig | FL "WAC"
Set-OrganizationConfig -WACDiscoveryEndPoint
https://office.tshoot.com/hosting/discovery
=============================================================
=============================================================
=============================================================
Get-TransportConfig
Get-TransportConfig | FL *max*
Set-TransportConfig -MaxSendSize 20MB -MaxReceiveSize 20MB
=============================================================
Get-RemoteDomain
New-RemoteDomain -Name ECST -DomainName ecst.com
Set-RemoteDomain ECST -AutoForwardEnabled $false -DeliveryReportEnabled $false
Remove-RemoteDomain ECST
=============================================================
=============================================================
=============================================================
=============================================================
=============================================================
=============================================================
$Credentials = Get-Credential
Import-PSSession $Session
Get-Mailbox
Get-DistributionGroup
=============================================================
=============================================================
=============================================================
selecting /domaincontroller: