Categoria: Exchange 2016

Hybrid Exchange – manage certificates

On Premise, to view installed certificate

Get-ExchangeCertificate

On Premise, to link a new certificate in a multiple services:

Enable-ExchangeCertificate -Thumbprint [thumbprint’s new certificate] -Services IMAP,POP,IIS,SMTP

On Premise, to remove the old certificate:

Remove-ExchangeCertificate -Thumbprint [thumbprint’s new certificate]

***

Certificate linked to the office 365 connector

***

On Premise, to link the new certificate to the Office365 send connector:

$cert = Get-ExchangeCertificate -Thumbprint [thumbprint’s new certificate]
$tlscertificatename = “$($cert.Issuer)$($cert.Subject)”
Set-SendConnector “Office 365 send connector” -TlsCertificateName $tlscertificatename

On Premise, to link the new certificate to the Office365 receive connector:

$cert = Get-ExchangeCertificate -Thumbprint [thumbprint’s new certificate]
$tlscertificatename = “$($cert.Issuer)$($cert.Subject)”
Set-ReceiveConnector “[exchangeserver\connector name]” -TlsCertificateName $tlscertificatename

On Premise, to view the new certificate linked to receive connector:

Get-ReceiveConnector |ft identity, TlsCertificateName, TlsDomainCapabilities -TlsCertificateName

Exchange 2016 – enable forward by PS

With this command you can enable an automatically forward from internal mailbox to an external mailbox with copy:

Set-Mailbox -Identity “John Travolta” -DeliverToMailboxAndForward $true -ForwardingSMTPAddress “user.one@home.net”

Type this command to check the configuration applied in a mailbox:

Get-Mailbox “user.one@home.net” | Format-List ForwardingSMTPAddress,DeliverToMailboxandForward

Exchange 2016 – 5.7.54 SMTP; Unable to relay recipient in non-accepted

Exchagne 2016 error: 5.7.54 SMTP; Unable to relay recipient in non-accepted

Find the receive connector contain ip of smtp client;

to view all send connector use this PS command:

 

Get-ReceiveConnector

 

and after you find the receive connector in use try this command:

 

Get-ReceiveConnector –Identity “your_server\your_receive_connector” | Add-ADPermission -User “NT AUTHORITY\ANONYMOUS LOGON” -ExtendedRights “Ms-Exch-SMTP-Accept-Any-Recipient”

 

 

Exchange 2010 – remove mailbox – disabled or soft deleted

This command help you to view all deleted o r disabled mailbox in a specific database. PS command

Get-MailboxStatistics -Database “database” | Where-Object {$_.DisconnectDate -Notlike $NULL} | Format-Table DisplayName, DisconnectDate, MailboxGuid, DisconnectReason –Wrap

 

This command help you to remove SoftDeleted mailbox in a specific database.

$Mailboxes = Get-MailboxStatistics -Database “database” | where {$_.DisconnectReason -eq “SoftDeleted”}
$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

 

This command help you to remove Disabled mailbox in a specific database.

$Mailboxes = Get-MailboxStatistics -Database “database” | where {$_.DisconnectReason -eq “Disabled”}
$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled}

Exchange 2016 – Move Mailbox – with Archiving

This command help you to migrate a mailbox in other DB, from PS.

 

To move user@domain.com to Database and archive in DataBaseArchiving:

Get-Mailbox user@domain.com | New-MoveRequest -TargetDatabase “DataBase” -BadItemLimit unlimited -AcceptLargeDataLoss:$true -SuspendWhenReadyToComplete:$true -ArchiveTargetDatabase “DataBaseArchiving”

 

This command help you to view all the mailbox move:

Get-MoveRequest | Get-MoveRequestStatistics

 

This command help you to del a specific mailbox move:

Remove-MoveRequest user@domain.com