Visualizzazione post con etichetta Exchange. Mostra tutti i post
Visualizzazione post con etichetta Exchange. Mostra tutti i post

lunedì 25 aprile 2022

Exchange -Hafnium - Marzo 2021

 Note su Exchange HAfiun

Dal 6 Gennaio (data di pubblicazione della vulnerabilita') al 2 Marzo 2021 l'exchange potrebbe essere stato bucato.

Lista letture utili

REFERENCE

https://www.informaticar.net/what-to-do-if-you-were-breached-by-hafnium-exchange-breach/

https://www.informaticar.net/microsoft-exchange-march-2021-breach-hafnium/

https://techcommunity.microsoft.com/t5/exchange-team-blog/march-2021-exchange-server-security-updates-for-older-cumulative/ba-p/2192020

https://msrc-blog.microsoft.com/2021/03/02/multiple-security-updates-released-for-exchange-server/

https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers/

https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers/

https://www.reddit.com/r/sysadmin/comments/lz1jp4/youve_been_hit_by_youve_been_struck_by_an/

https://www.crowdstrike.com/blog/falcon-complete-stops-microsoft-exchange-server-zero-day-exploits/

https://www.cisa.gov/emergency-directive-21-02

https://www.bleepingcomputer.com/news/security/dearcry-ransomware-attacks-microsoft-exchange-with-proxylogon-exploits/


lunedì 24 gennaio 2022

Note sulla conversione di cassette postali utente in shared, in ambiente ibrido Microsoft 365.

 Note sulla conversione di cassette postali utente in shared, in ambiente ibrido Microsoft 365.


Mi e' capitato di dover convertire una casella di posta utente in una casella condivisa, in un ambiente ibrido di Microsoft 365.

La casella era gia su Microsoft 365.

Ho letto di vari suggerimenti, tra cui quello di riportarla on-prem, trasformarla in condivisa e riportarla online.


Io personalmente ho seguito una strada diversa, facendo riferimento al link sotto.


La prima cosa che ho notato e' che, solo per gli utenti sincronizzati con AD, devo entrare direttamente nell'interfaccia di amministrazione di 

Exchange online per poter convertire la casella.

Dopodiche ho seguito le istruzioni:


siccome la casella era gia su 365, dalla prospettiva dell'exchange on-prem, stiamo parlando di una cassetta remota.

A questo punto, dalla powershell di exchange on-prem eseguo il seguente comando:


Get-RemoteMailbox

per verificare se tra le caselle remote appare quella da convertire


Dopodiche eseguo il seguente comando

Set-RemoteMailbox "Giacomo Puccini" -Type Shared


Se tutto e' andato bene, dalla GUI on prem devo vedere la casella apparire tra le condivise.

Potrebbe essere necessario aspettare un attimo, prima che l'operazione diventi effettiva.


A questo punto mi sarei immaginato il miracolo e che dopo un po la  casella online si trasformasse in shared.

Purtroppo nessun miracolo, e cosi ho deciso di interventire manualmente:


Interfaccia di amministrazione di Microsoft 365-Exchange online, ricerca della mailbox, che on prem risulta shared, ma che online risulta ancora regular (utente),


converti in shared andando in https://admin.exchange.microsoft.com/#/mailboxes (selezionare utente e premere sul link)


Ho aspettato un po per dare il tempo ad exchange di fare i suoi ragionamenti e quindi sono tornato on prem.


Di solito l'utente delle caselle condivise risulta disattivo in AD.

Nel mio caso non e' successo neppure questo.

Ho disattivato l'utente a mano e verificato che tutto funzionasse.


A questo punto posso rimuovere la licenza di 365 dall'utente xche le caselle shared non necessitano di licenza.


OPINIONI

Penso che non dovrebbe funzionare cosi la conversione. In parte potrebbe dipendere dal fatto che la versione di AD che stiamo usando non ha il write-back.

Ma la conversione in shared on prem, non ha comunque fatto nulla. 

Forse non ho aspettato abbastanza... 


Insomma questi sono solo appunti di come ho svolto questa attivita, probabilmente in modo sbagliato :)


REFERENCE

https://www.alitajran.com/convert-user-mailbox-to-shared-mailbox-exchange-hybrid/


mercoledì 5 gennaio 2022

Exchange 2016-2019 - code bloccate - Buon 2022 Exchange

 Exchange 2016-2019 - Baco anno nuovo 2022


Il nostro exchange ci ha regalato un baco per il nuovo anno 2022.

Se nel registro degli eventi appare uqesto errore:


Errore rilevato FIPFS - 5300


Impossibile eseguire la scansione dei messaggi per cui questi rimangono in coda.

Eseguire lo script nella cartella x sbloccare


Vuol dire che ne siete affetti.


Il motore di scansione non riesce a processare i messaggi in coda e quindi non li spedisce.

In breve occorre aggiornare il motore di scansione per sistemare.

In fondo trovate i link a cui fare riferimento.


Dopo che ha terminato attendere che venga aggiornato l'engine di scansione 

Add-PSSnapin Microsoft.Forefront.Filtering.Management.Powershell

Get-EngineUpdateInformation


I messaggi dovrebbero ripartire dopo che l'aggiornamento si e' concluso.


Potrebbe essere necessario riavviare i servizi di exchange od il server stesso (anche se lo fa gia lo script)


In presenza di errori e' possibile forzare l'aggiornamento del motore di scansione

Andare nella cartella degli script di Exchange:

E:\Microsoft\Exchange Server\V15\Scripts ed eseguire il seguente comando:

.\Update-MalwareFilteringServer.ps1 MAILBOX01.domain.local


L'aggiornamento e' molto lungo e potrebbe richiedere fino a quasi un'ora. Dipende anche dalla velocita della linea internet.


Dopo che l'aggiornamento e' completo si puo provare a rispedire i messaggi in coda:

Retry-Queue –Server "MAILBOX01" -Filter {Status -eq "Retry"} -Resubmit $True


Se ancora i messaggi non dovessero andare l'errore potrebbe essere legato ai troppi tentativi gia effettuati.

Per averne la certezza occorre verificare i log. Potrebbe essere necessario abilitarli:


Verifica dello stato attuale di logging (nel mio caso NONE)

Get-TransportService MAILBOX01 |fl *level*

Get-FrontEndTransportService MAILBOX01 |fl *level*


MODIFICA LIVELLO DI LOGGING

Set-TransportService MAILBOX01 -IntraOrgConnectorProtocolLoggingLevel Verbose

Set-FrontEndTransportService MAILBOX01 -IntraOrgConnectorProtocolLoggingLevel Verbose


Riforzare la spedizone dei messaggi in coda ed analizzare i log


Nel mio caso ho fatto in questo modo: ho disattivato il malware agent ed il transport agent rule agent, 

riavviato il servizio di trasporto e riforzato l'invio.

Quindi ho riattivato i 2 agenti disabilitati, riavviato il servizio di trasporto e rieseguito un riavvio del servizio.

La coda in questo modo e' stata smaltita ed i messaggi nuovi sono partiti regolarmente.


Verifica della situazione

Get-TransportAgent


Disattivazione agenti transport rule e malware agent

Disable-TransportAgent "Transport rule agent"

Disable-TransportAgent "Malware Agent"

Restart-Service MSExchangeTransport


Processare la coda in modo forzato

Retry-Queue –Server "MAILBOX01" -Filter {Status -eq "Retry"} -Resubmit $True


Verifica delle code

Get-queue


Al termine dello smaltimento della coda, riavviare gli agenti disattivati.


Attivazione agenti transport rule e malware agent

Enable-TransportAgent "Transport rule agent"

Enable-TransportAgent "Malware Agent"

Restart-Service MSExchangeTransport


Verifica finale della situazione

Get-TransportAgent


Adesso occorre verificare regolarmente le code nel corso delle prox ore/gg.

Get-queue


REFERENCE

https://techcommunity.microsoft.com/t5/exchange-team-blog/email-stuck-in-exchange-on-premises-transport-queues/ba-p/3049447

https://docs.microsoft.com/en-us/exchange/troubleshoot/setup/manually-update-scan-engines

https://docs.microsoft.com/it-it/exchange/mail-flow/transport-agents/manage-transport-agents?view=exchserver-2019

https://techgenix.com/resubmitmessagesinqueues/

https://docs.microsoft.com/en-us/exchange/mail-flow/connectors/configure-protocol-logging?view=exchserver-2019#use-the-exchange-management-shell-to-enable-or-disable-protocol-logging-on-the-intra-organization-send-connector

https://www.alitajran.com/exchange-mail-flow-breaks/

https://docs.microsoft.com/it-it/exchange/mail-flow/queues/queue-procedures?view=exchserver-2019




APPENDICE

Prova a rispedire tutti i messaggi nella coda 3

Retry-Queue "MAILBOX01\3" -Resubmit $True


Prova a rispedire tutti i messaggi di tutte le code

Retry-Queue –Server “MAILBOX01” -Filter {Status -eq "Retry"} -Resubmit $True



Cancellare tuttu i messaggi dalla coda (senza mandare NDR di notifica

Get-Message -Queue "MAILBOX01\3" | Remove-Message -WithNDR $false -Confirm:$false


Cancellare un messaggio specifico

Get-ExchangeServer |

    ?{$_.IsHubTransportServer -eq $true} |

    Get-Queue |

    get-message |

    ? {$_.sender -eq 'Vinc@somedomain.uhoh'} |

    Remove-Message -withNDR $false



martedì 21 settembre 2021

Installazione Exchange 2016 - Aggiornamento Exchange

Ciao a tutti,

ho deciso di condividere un po di appunti e di note che ho buttato giu per le installazioni di Exchange. Sono un insieme non troppo connesso, e per usarli occorre avere un minimo di conoscenza della materia (non fenomeni, ma neppure essere totalmente all'oscuro!). Se eseguite solo i comandi elencati, senza cognizione, ci sono forti probabilità che facciate un casino. Ma sono anche una buona traccia da cui partire e sulla quale effettuare gli aggiustamenti del vostro caso. :)

NOTE

Controllate molto bene le note di exchange, sulla coesistenza e sulla versione di net framework. La versione sbagliata di net framework puo fare veramente tanti danni.

REFERENCES

http://techgenix.com/migrating-small-organization-exchange-2010-exchange-2016-part6/


Aggiornamento Exchange versione ibrida

https://www.itpromentor.com/upgrade-hybrid-2016/


=========================================================================VERIFICA DELL'AMBIENTE (EXCHANGE 2010)

Start-Transcript EnvironmentBackup.txt

Get-OutlookProvider | Format-List

Get-OutlookAnywhere | Format-List

Get-ClientAccessServer | Format-List

Get-ActiveSyncVirtualDirectory | Format-List

Get-AutodiscoverVirtualDirectory | Format-List

Get-EcpVirtualDirectory | Format-List

Get-OabVirtualDirectory | Format-List

Get-OwaVirtualDirectory | Format-List

Get-PowerShellVirtualDirectory | Format-List

Get-WebServicesVirtualDirectory | Format-List

Get-SendConnector | Where-Object {$_.Enabled -eq $true} | Format-List

Get-SendConnector | Where-Object {$_.Enabled -eq $true} | Get-ADPermission | Where-Object { $_.extendedrights -like '*routing*' } | fl identity, user, *rights

nslookup -type=a mail.domain.com

nslookup -type=a autodiscover.domain.com

nslookup -type=a mail.domain.com 8.8.8.8

nslookup -type=a autodiscover.domain.com 8.8.8.8

nslookup -type=mx domain.com 8.8.8.8

nslookup -type=txt domain.com 8.8.8.8

nslookup -type=a i-should-not-exist.domain.com 8.8.8.8

Stop-Transcript

OPPURE

VERIFICA SPAZIO LIBERO SU DB DEI SERVER

https://gallery.technet.microsoft.com/office/Exchange-2010-Architecture-9368ff56

Get-MailboxDatabase (recupero il nome del DB)

Get-MailboxDatabase "Mailbox Database 1596579151" -status |fl ava*

=========================================================================



=========================================================================EXCHANGE 2010 - INSTALLAZIONE PREREQUISITI

https://technet.microsoft.com/en-us/library/bb691354(v=exchg.141)

http://www.telnetport25.com/2011/04/prerequisites-for-installing-exchange-2010-sp1-on-windows-2008-r2/


Import-Module ServerManager

MAILBOX

Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy,Web-WMI -Restart

CLIENT ACCESS/HUB TRANSPORT

Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy,Web-WMI -Restart

MAILBOX ONLY

Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server -Restart

IMPOSTAZIONE SERVIZIO

Set-Service NetTcpPortSharing -StartupType Automatic

=========================================================================



=========================================================================install exchange 2016 prereq

https://gallery.technet.microsoft.com/office/Install-Exchange-2016-48983e13

verificare lo schema di Exchange

https://blogs.technet.microsoft.com/rmilne/2015/03/17/how-to-check-exchange-schema-and-object-values-in-ad/

=========================================================================



=========================================================================Enable access from remote: winrm quickconfig

=========================================================================



=========================================================================VERIFICA NET FRAMEWORK INSTALLED

Verificare che i requisiti necessari alla versione di Exchnage che si sta installando siano coerenti con quella sul PC

https://gallery.technet.microsoft.com/scriptcenter/Detect-NET-Framework-120ec923

PATCH EXCHANGE SU WINDOWS SERVER 2016

https://blogs.technet.microsoft.com/exchange/2016/11/04/update-on-windows-server-2016-and-exchange-server-2016/

EXCHANGE 2016 CU6 - Blocco installazione .NET Framework 4.7

https://blogs.technet.microsoft.com/exchange/2017/06/13/net-framework-4-7-and-exchange-server/

https://support.microsoft.com/en-us/help/4024204/how-to-temporarily-block-installation-of-the-net-framework-4-7

=========================================================================



=========================================================================CREAZIONE FILE DUMMY VUOTO DA 1 GB

fsutil file createnew E:\dummy01.txt 1073741824

=========================================================================



=========================================================================AGGIORNAMENTO MANUALE SCHEMA - Se ambiente ibrido andare al passo successivo


eseguire dalla schema master - richiede i permessi di schema master (probabilmente occorre aggiungere l'utente al gruppo)


"exchange schema version = " + ([ADSI]("LDAP://CN=ms-Exch-Schema-Version-Pt," + ([ADSI]"LDAP://RootDSE").schemaNamingContext)).rangeUpper


N.B. se Exchange non e' mail stato installato prima dara un valore vuoto come risultato


setup /prepareschema /IAcceptExchangeServerLicenseTerms


"exchange schema version = " + ([ADSI]("LDAP://CN=ms-Exch-Schema-Version-Pt," + ([ADSI]"LDAP://RootDSE").schemaNamingContext)).rangeUpper

https://eightwone.com/references/schema-versions/


get-organizationconfig (x verificare il nime dell'organizzazione exchange, se gia esistente)


setup /preparead /Organizationname:PIPPO /IAcceptExchangeServerLicenseTerms

Verificare se viene creato la OU Microsoft Exchange Security Group (view advanced feature)


setup /preparealldomains /IAcceptExchangeServerLicenseTerms


Finite le operazioni preliminari per preparare AD


=========================================================================



=========================================================================AGGIORNAMENTO MANUALE SCHEMA - AMBIENTE IBRIDO


"A hybrid deployment with Office 365 has been detected.  Please ensure that

you are running setup with the /TenantOrganizationConfig switch.  To use the Ten

antOrganizationConfig switch you must first connect to your Exchange Online tena

nt via PowerShell and execute the following command: “Get-OrganizationConfig | E

xport-Clixml -Path MyTenantOrganizationConfig.XML”.  Once the XML file has been

generated, run setup with the TenantOrganizationConfig switch as follows “/Tenan

tOrganizationConfig MyTenantOrganizationConfig.XML”."


d:\setup.exe /PrepareAD /TenantOrganizationconfig:C:\script\0365oconfig.xml /IAcceptExchangeServerLicenseTerms


UPGRADE ACTIVE DIRECTORY 

Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms (requires Enterprise Admins and Schema Admins permissions, and must be performed in the same AD Site as the Schema Master on a server with the RSAT-ADDS-Tools feature installed – the Schema Master itself would meet these requirements)

Setup.exe /PrepareAD /IAcceptExchangeServerLicenseTerms

Setup.exe /PrepareDomain /IAcceptExchangeServerLicenseTerms

=========================================================================



=========================================================================Installazione a riga di comando

.\Setup.exe /mode:install /role:Mailbox /targetdir:"D:\Program Files\Microsoft\Exchange Server\V15" /MdbName:Mail01 /DbFilePath:"E:\DB\Mail01.edb" /LogFolderPath:"F:\Mail01" /DisableAMFiltering /InstallWindowsComponents /IAcceptExchangeServerLicenseTerms

.\Setup.exe /mode:install /role:Mailbox /targetdir:"D:\Program Files\Microsoft\Exchange Server\V15" /MdbName:Mail02 /DbFilePath:"E:\DB\Mail02.edb" /LogFolderPath:"F:\Mail02" /DisableAMFiltering /InstallWindowsComponents /IAcceptExchangeServerLicenseTerms

Al termine riavviare e cominciare la configurazione:

=========================================================================



=========================================================================EXCHANGE 2016 INSTALLAZIONE

L'installazione di Exchange 2016 in automatico effettua l'aggiornamento dello schema e del dominio. Nel caso di presenza di un abiente ibrido pogtrebbe apparire il seguente erore:

“A hybrid deployment with Office 365 has been detected. Please ensure that you are running setup with the /TenantOrganizationConfig switch”


Per risolvere occorre collegarsi al tenant per scaricare l'XML della configurazione dell'organizzazione e quindi eseguire il preparead.


Collegarsi in powershell al tenant ed eseguire il comando

Get-OrganizationConfig | Export-Clixml -Path MyTenantOrganizationConfig.XML


Montare la ISO di Exchange ed eseguire il seguente comando

Setup.exe /PrepareAD /TenantOrganizationConfig MyTenantOrganizationConfig.xml /IAcceptExchangeServerLicenseTerms

Questo comando esegue anche l'aggiornamento dello schema.


Per finire andare nella console di azure ad connect e fare un refresh dello schema


REFERENCE

https://practical365.com/installing-the-first-exchange-2016-server-fails-in-hybrid-environment/

=========================================================================



=========================================================================ACCEPTED DOMAIN (solo se serve aggiungere nuovi domini oltre a quelli gia presenti)

VERIFICA

Get-AcceptedDomain


AGGIUNTA

New-AcceptedDomain –Name “dominio.net” –DomainName dominio.net –DomainType Authoritative


MODIFICA DEFAULT ACCEPTED DOMAIN

Set-AcceptedDomain -identity dominio.net -MakeDefault $true


RIMOZIONE

Remove-AcceptedDomain –Identity dominio.net

=========================================================================



=========================================================================Impostare il certificato Exchange

Import-ExchangeCertificate -FileData ([Byte[]$(Get-content -Path c:\SSL\Wild-Trap.pfx -Encoding byte -ReadCount 0)) -Server EXCH2016 -FriendlyName WildTrap -Password:(Get-Credential).password

Get-ExchangeCertificate -Server EXCH2016 (da qui si ricava il thumbprint)

Enable-ExchangeCertificate -Thumbprint 834F2EAACF96260C399D9C32B862B14134B73931 -Services "IIS, SMTP, POP, IMAP" -Server EXCH2016

Oppure si puo procedere tramite GUI

Andare sul vecchio server aprire MMC - add/remove snapins - certificates - computer

Scegliere personal ed individuare il certificato utilizzato dal vecchio Exchange

Scegliere tutte le attivita - esporta

Esportare anche la chiave privata - esporta le proprieta estese e tutti i certificati

Verra chiesto di inserire una password ed infine verra creato un file .pfx

Copiare il file sul nuovo server ed importarlo dalla stessa console.

Quindi accedere ad Exchange e verificare la presenza del certificato (potrebbe servire il riavvio di qualche servizio, es IIS)

=========================================================================



=========================================================================Configurazione Autodiscovery - SCP

mail.dominio.net e' il "nome virtuale" del server che abbiamo creato. L'autodiscover va configurato per ogni server installato

Set-ClientAccessService -Identity EXCH2016 -AutodiscoverServiceInternalUri https://mail.dominio.net/Autodiscover/Autodiscover.xml

Get-ClientAccessService |fl Identity,AutoDiscoverServiceInternalUri,OutlookAnywhereEnabled

VERIFICA SCP IN ADSI EDIT

ESEMPIO DI PATH

CN=EXCH2016,CN=Autodiscover,CN=Protocols,CN=EXCH2016,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=testsrl,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=test,DC=local

https://EXCH2016.test.local/Autodiscover/Autodiscover.xml

verifica SCP in AD: adsi edit confguration/services/microsoft exchange/organization name/administrative groups/exchange administrative groups/servers/nome server/protocols/autodiscover

parametro ServiceBindingInformation

=========================================================================



=========================================================================Configurazione VirtualFolder


$Server = "EX1601"

$HTTPS_FQDN = "mail.dominio.net"

Get-OWAVirtualDirectory -Server $Server | Set-OWAVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/owa" -ExternalURL "https://$($HTTPS_FQDN)/owa"

Get-ECPVirtualDirectory -Server $Server | Set-ECPVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/ecp" -ExternalURL "https://$($HTTPS_FQDN)/ecp"

Get-OABVirtualDirectory -Server $Server | Set-OABVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/oab" -ExternalURL "https://$($HTTPS_FQDN)/oab"

Get-ActiveSyncVirtualDirectory -Server $Server | Set-ActiveSyncVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/Microsoft-Server-ActiveSync" -ExternalURL "https://$($HTTPS_FQDN)/Microsoft-Server-ActiveSync"

Get-WebServicesVirtualDirectory -Server $Server | Set-WebServicesVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/EWS/Exchange.asmx" -ExternalURL "https://$($HTTPS_FQDN)/EWS/Exchange.asmx"

Get-MapiVirtualDirectory -Server $Server | Set-MapiVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/mapi" -ExternalURL "https://$($HTTPS_FQDN)/mapi"

Get-PowerShellVirtualDirectory -Server $Server | Set-PowerShellVirtualDirectory -InternalURL "https://$($HTTPS_FQDN)/powershell" -ExternalURL "https://$($HTTPS_FQDN)/powershell"


iisreset (dalla console del server appena installato)


Verifica

Get-AutodiscoverVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-ClientAccessService |fl Identity,AutoDiscoverServiceInternalUri,OutlookAnywhereEnabledGet-OWAVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-ECPVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-OABVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-ActiveSyncVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-WebServicesVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-MapiVirtualDirectory |fl server,name,identity,internalurl,externalurl

Get-PowerShellVirtualDirectory |fl server,name,identity,internalurl,externalurl


For references

https://blogs.technet.microsoft.com/exchange/2010/09/23/default-settings-for-exchange-related-virtual-directories-in-exchange-server-2010/

https://technet.microsoft.com/en-us/library/gg247612(v=exchg.160).aspx

MANAGE VIRTUAL DIRECTORIES

https://social.technet.microsoft.com/wiki/contents/articles/5163.managing-exchange-2010-externalinternal-url-s-via-powershell.aspx

RESET VIRTUAL DIRECTORIES

https://technet.microsoft.com/en-us/library/ff629372(v=exchg.141).aspx

=========================================================================



=========================================================================Rimuovere le external URL dalle virtual directory - solo per info, non e' da fare

$Server = "EXCH2016"

Get-OWAVirtualDirectory -Server $Server | Set-OWAVirtualDirectory -ExternalURL $null

Get-ECPVirtualDirectory -Server $Server | Set-ECPVirtualDirectory -ExternalURL $null

Get-OABVirtualDirectory -Server $Server | Set-OABVirtualDirectory -ExternalURL $null

Get-ActiveSyncVirtualDirectory -Server $Server | Set-ActiveSyncVirtualDirectory-ExternalURL $null

Get-WebServicesVirtualDirectory -Server $Server | Set-WebServicesVirtualDirectory-ExternalURL $null

=========================================================================



=========================================================================Configurazione OutlookAnywhere

Set-OutlookAnywhere -identity "EXCH2016\Rpc (Default Web Site)" -ExternalHostname "mail.dominio.net" -ExternalClientAuthenticationMethod Negotiate -ExternalClientsRequireSsl:$True

Set-OutlookAnywhere -identity "EXCH2016\Rpc (Default Web Site)" -InternalHostname "mail.dominio.net" -InternalClientAuthenticationMethod ntlm -InternalClientsRequireSsl:$True

Set-OutlookAnywhere -identity "TESTEX1602\Rpc (Default Web Site)" -ExternalHostname "mail.dominio.net" -ExternalClientAuthenticationMethod Negotiate -ExternalClientsRequireSsl:$True

Set-OutlookAnywhere -identity "TESTEX1602\Rpc (Default Web Site)" -InternalHostname "mail.dominio.net" -InternalClientAuthenticationMethod ntlm -InternalClientsRequireSsl:$True

Get-OutlookAnywhere | fl Identity,ExchangeVersion,*hostname*,*Client*,IISAuthenticationMethods,SSLOffloading

Get-OutlookAnywhere | fl server,identity,*host*,*auth*,SSLOffloading (come sopra)

=========================================================================



=========================================================================OUTLOOK ANYWHERE NOTES

https://blogs.technet.microsoft.com/exchange/2013/05/23/ambiguous-urls-and-their-effect-on-exchange-2010-to-exchange-2013-migrations/

https://technet.microsoft.com/en-us/library/bb123741(v=exchg.141).aspx

Enable-OutlookAnywhere -Server $Server -ClientAuthenticationMethod Basic -SSLOffloading $False -ExternalHostName $HTTPS_FQDN -IISAuthenticationMethods NTLM, Basic

then change dns name to point exchange 2013 instead of 2010

Moving Mailboxes creates logs, the more you move, the more logs it creates. The only way to clear these logs properly is to do an Exchange Aware/VSS Level backup. If you just start moving mailboxes without keeping an eye on this you can fill up a volume with logs, and if you are daft enough to have this on our system volume you can take the server down, you have been warned! 


Under Microsoft Exchange proxy settings, the default are:

 - on fast network connect using http first, then using tcp/ip

 X on slow network connect using http first, then using tcp/ip


To use OutlookAnywhere to force the HTTP protocol we need this:

-->    X on fast network connect using http first, then using tcp/ip  <--

       X on slow network connect using http first, then using tcp/ip

to check also the first option

this allow Outlook to be forced to use http connection over TCP, which is needeed for coexistence and migration

This is made by autodiscover service by changing the outlook provider


CHECK THE SETTINGS BEFORE ANY CHANGES

Get-OutlookProvider EXPR |fl name, OutlookProviderFlags

Get-OutlookProvider EXCH |fl name, OutlookProviderFlags

Get-OutlookProvider WEB |fl name, OutlookProviderFlags



FORCE CLIENTS CONNECTED TO EXCHANGE 2010 USING OUTLOKANYWHERE TO USE HTTPS

The following commands are executed from the Exchange 2010 Management Shell.

Set-OutlookProvider EXPR -OutlookProviderFlags:ServerExclusiveConnect

Set-OutlookProvider EXCH -OutlookProviderFlags:ServerExclusiveConnect


If for any reason you need to put the configuration back to its default settings, issue the following commands and clients will no longer prefer HTTP on Fast Networks.


RESTORE DEFAULT SETTINGS

Set-OutlookProvider EXPR -OutlookProviderFlags:None

Set-OutlookProvider EXCH -OutlookProviderFlags:None

=========================================================================



=========================================================================CREAZIONE SEND CONNECTOR

New-SendConnector -Name "InternetEXCH2016" -Usage Internet -AddressSpaces '*' -SourceTransportServers EXCH2016 -DNSRoutingEnabled:$True

#New-SendConnector -Name "InternetEXCH2016" -Usage Internet -AddressSpaces {smtp:*;10} -SourceTransportServers TESTEX1602 -DNSRoutingEnabled:$True

=========================================================================



=========================================================================CREAZIONE RECEIVE CONNECTOR

Se fosse utilizzato un connettore per mandare le scansioni x email agli utenti interni, e' necessario icreare il connettore di ricezione.

Controllare ed importare le impostazioni da quello precedente

New-ReceiveConnector -Name “Allowed Anonymous Relay” -Usage Custom -TransportRole FrontEnd -PermissionGroups AnonymousUsers,ExchangeServers -AuthMechanism Tls,ExternalAuthoritative -Bindings 10.11.12.37:25 -RemoteIPRanges 10.11.12.250-10.11.12.251,10.11.12.240,10.11.12.230

=========================================================================



=========================================================================SPOSTAMENTO DATABASE (SE NECESSARIO)

Move-DatabasePath -Identity Mail01 -EdbFilePath E:\Mail01\Mail01.edb -LogFolderPath E:\Mail01

Move-DatabasePath -Identity Mail02 -EdbFilePath E:\Mail02\Mail02.edb -LogFolderPath E:\Mail02

=========================================================================



=========================================================================SPOSTAMENTO MAILBOX DI SISTEMA


Get-Mailbox –RecipientTypeDetails DiscoveryMailbox | Format-Table Name, Database

Get-Mailbox -RecipientTypeDetails DiscoveryMailbox | New-MoveRequest -TargetDatabase db01


Get-Mailbox –Arbitration

Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase db01


REFERENCE

https://www.ntweekly.com/2016/01/04/find-and-move-discovery-mailboxes-exchange-server/

=========================================================================



=========================================================================CONFIGURAZIONE DNS


INTERNO

mail.dominio.net IN A 10.11.12.37

autodiscover.dominio.net IN CNAME mail.dominio.net (si puo mettere il CNAME, perche un server DNS non mette in cache i nomi del dominio di cui e' responsabile. IL dns dominio.net non mette in cache i risultati per il poprio dominio)


ESTERNO

mail.dominio.net IN A 89.96.73.33

autodiscover.dominio.net IN CNAME mail.dominio.net (vedi sopra)

=========================================================================



=========================================================================SPOSTAMENTO PUBLIC FOLDER

Potrebbe essere necessario spostare i public folder, se utilizzati. Da Exchange 2013 in poi i PF si appoggiano ad una mailbox, mentre fino a 2010 utilizzavano un proprio DB.

Da 2013 in poi si parla di "modern public fiolder", mentre quelly fino a 2010 sono legacy PF.

I modern public folder sono poco piu che lo spostamento di una mailbox.

LA migrazione dei PF da 2010 e molto piu complessa e presenta diversi step, ed una migrazione batch. Viene dato inoltre un certo periodo di disservizio.

E' importante ricordarsi che una volta che i PF sono su 2016, le mailbox su 2010 non potranno accedervi. E' consigliabile per questo motivo spostare tutte le mailbox su 2016 prima di iniziare la migrazione dei PF.


Scaricare da questo link gli script di migrazione

https://www.microsoft.com/download/details.aspx?id=38407


EXCHANGE 2010

Creare degli snapshot dei PF prima di iniziare. Ci serviranno successivamente per un confronto

Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Legacy_PFStructure.xml

Get-PublicFolderStatistics | Export-CliXML C:\PFMigration\Legacy_PFStatistics.xml

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:\PFMigration\Legacy_PFPerms.xml


EXCHANGE 2010

Verificare che non siano presenti dei PF con il carattere / o \ nel nome. Se presenti rinominarli

Get-PublicFolderStatistics -ResultSize Unlimited | Where {($_.Name -like "*\*") -or ($_.Name -like "*/*") } | Format-List Name, Identity


Comando per riinominare i PF se necessario

Set-PublicFolder -Identity <public folder identity> -Name <new public folder name>


EXCHANGE 2010

Verificare che non ci siano migrazioni iniziate, in corso oppure sospese. Se una delle proprieta sotto sono impostate a $true occorre riportarle a $false per portare avanti la migrazione

Get-OrganizationConfig | Format-List PublicFoldersLockedforMigration, PublicFolderMigrationComplete


Per modificare i valori, se necessario:

Set-OrganizationConfig -PublicFoldersLockedforMigration $false -PublicFolderMigrationComplete $false


Potrebbero volerci fino ad un paio di ore perche questi parametri si aggiornino.


EXCHANGE 2016

Adesso occorre verificare l'ambiente 2016 prima di cominciare

Se ci fosse in corso una migrazione occorre resettare alcuni parametri, ma anche capire perche e' stata interrotta.


$batch = Get-MigrationBatch | ?{$_.MigrationType.ToString() -eq "PublicFolder"}

Eseguire il comando seguente per rimuovere eventuali richieste di migrazione batch di cartelle pubbliche esistenti.


$batch | Remove-MigrationBatch -Confirm:$false


Verifica la presenza dei public folder

Get-Mailbox -PublicFolder

Get-PublicFolder


Se i PF su 2016 sono gia presenti, vanno rimossi per poter procedere con la migrazione. Fate attenzione perche se si procede, i dati nei PF andranno perduti!

Get-Mailbox -PublicFolder | Where {$_.IsRootPublicFolderMailbox -eq $false} | Remove-Mailbox -PublicFolder -Force -Confirm:$false

Get-Mailbox -PublicFolder | Remove-Mailbox -PublicFolder -Force -Confirm:$false


EXCHANGE 2010

Adesso useremo gli script scaricati per generare dei file csv che verranno usati successivamente

.\Export-PublicFolderStatistics.ps1 C:\PFMigration\name-to-folder.csv server2010.dominio.local


La dimensione dei PF su Exchange 2010 e' di 2 GB circa. Ho deciso di ijmpostar euna dimensione max di 10 GB, che in byte e' il numero sotto.

.\PublicFolderToMailboxMapGenerator.ps1 10.737.418.240 C:\PFMigration\name-to-folder.csv C:\PFMigration\folder-to-mailbox.csv


Adesso occorre copiare i csv creati su Exchange 2016

C:\PFMigration\name-to-folder.csv

C:\PFMigration\folder-to-mailbox.csv


EXCHANGE 2016

Creazione della mailbox x i PF su Exchange 2016

.\Create-PublicFolderMailboxesForMigration.ps1 -FolderMappingCsv C:\PFMigration\folder-to-mailbox.csv -EstimatedNumberOfConcurrentUsers:20


EXCHANGE 2016

Creazione del batch di migrazione dei PF

New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server server2010.dominio.local) -CSVData (Get-Content C:\PFMigration\folder-to-mailbox.csv -Encoding Byte) -NotificationEmails administrator@dominio.it


Avvio del batch di migrazione

Start-MigrationBatch PFMigration


Adesso bisogna attendere un po fino allo stato sync


Per verificare lo stato di avanzamento usare il seguente comando

Get-PublicFolderMailboxMigrationRequest |fl


EXCHANGE 2010

Solo dopo che i PF sono arrivati allo stato sync eseguire il seguente comando.

Da adesso in poi i PF saranno bloccati e non disponibili

Set-OrganizationConfig -PublicFoldersLockedForMigration:$true


Potrebbe volerci un po di tempo per la propagazione.


EXCHANGE 2016

Eseguire adesso questi 2 comandi

Set-OrganizationConfig -PublicFoldersEnabled Remote

Complete-MigrationBatch PFMigration


Se ancora non fossero rilevati i PF bloccati, riavviare l'information store su Exchange 2010 e riprovare il completamento del batch di migrazione

Dopodiche aspettare, anche se a tratti potrebbe sembrare morto.


EXCHANGE 2016

Prima di passare definitivamente la gerarchia dei PF su 2016 e' bene fare un test di funzionamento.

Scegliamo un utente su 2016 ed eseguiamo il seguente comando

Se l'utente scelto si chiamo pippo e la mailbox dei PF si chiama mailbox1


Set-Mailbox -Identity pippo -DefaultPublicFolderMailbox mailbox1 


Adesso configuriamo un profilo outlook e verifichiamo che sia possibile accedere ai PF ed effettuiamo qualche test (creazione, cancellazione, verifica permessi ecc. ecc.)

Se tutto e' andato bene possiamo andare avanti, altrimenti possiamo tornare indietro.


Con questo comando sblocchiamo i pf

Get-Mailbox -PublicFolder | Set-Mailbox -PublicFolder -IsExcludedFromServingHierarchy $false


EXCHANGE 2010

Set-OrganizationConfig -PublicFolderMigrationComplete:$true


EXCHANGE 2016

Set-OrganizationConfig -PublicFoldersEnabled Local


EXCHANGE 2016

Al termine della migrazione possiamo rigenerare gli stessi xml che abbiamo generato all'inizio ed effettuare un confronto per valutare il risultato finale

Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Cloud_PFStructure.xml

Get-PublicFolderStatistics -ResultSize Unlimited | Export-CliXML C:\PFMigration\Cloud_PFStatistics.xml

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML  C:\PFMigration\Cloud_PFPerms.xml


EXCHANGE 2010

Adeeso siamo pronti a rimuovere il database dei public folder da Exchange 2010.

Remove-PublicFolderDatabase -Identity "PFDB01"


REFERENCE

https://docs.microsoft.com/it-it/exchange/collaboration/public-folders/batch-migration-from-previous-versions?view=exchserver-2016

https://assistants.microsoft.com/assistants/#/session/e119ee90-bbc7-4387-9094-6811dd11c829

https://docs.microsoft.com/it-it/exchange/decommission-on-premises-exchange

=========================================================================



=========================================================================ESEMPIO DI ANALISI LOG - utile, ad esempio, per verificare da quali connettori passano i messaggi


get-messagetrackinglog -Server "srvaep03b" -Start "09/19/2021 19:20:00" -End "09/19/2021 19:40:00" |Export-Csv C:\PFMigration\ccc.csv

=========================================================================



=========================================================================TEST EXCHANGE HEALTH SCRIPT

https://practical365.com/exchange-server/powershell-script-exchange-server-health-check-report/

PARAMETERS

    -Server, Perform a health check of a single server

    -ReportMode, Set to $true to generate a HTML report. A default file name is used if none is specified.

    -ReportFile, Allows you to specify a different HTML report file name than the default.

    -SendEmail, Sends the HTML report via email using the SMTP configuration within the script.

    -AlertsOnly, Only sends the email report if at least one error or warning was detected.

    -Log, Writes a log file to help with troubleshooting.

=========================================================================



=========================================================================NOTE SUI PROTOCOLLI

Inizialmente Outlook funzionava come MAPI Over RCP: mapi erano le istruzioni del client di posta incapsulate in un protocollo di trasporto (RCP). Tutto questo funzionava basandosi sul TCP.

Successivamente, per semplificare il passaggio dai firewall ed altri aspetti e' stato introdotto RPC over HTTPS, ridenominato in Exchange 2007 Outlook Anywhere.

In questo caso il mapi viene incapsulato nell'RPC, che a sua volta e' incapsulato nell'HTTPS (tre strati)

Infine da Exchnage 2013 CU qualche cosa SP1, il default e' diventato MAPI over HTTP. In questo caso viene completamente rimosso l'RPC e rimane il MAPI dentro l'HTTP, il che semplifica ulteriormente la gestione.

=========================================================================



=========================================================================RESOURCES

https://blogs.technet.microsoft.com/exchange/2015/10/12/the-exchange-2016-preferred-architecture/

https://blogs.technet.microsoft.com/exchange/2015/10/26/client-connectivity-in-an-exchange-2016-coexistence-environment-with-exchange-2010/

https://blogs.technet.microsoft.com/exchange/2015/05/05/exchange-server-2016-architecture/

https://blogs.technet.microsoft.com/exchange/2013/05/23/ambiguous-urls-and-their-effect-on-exchange-2010-to-exchange-2013-migrations/

http://techgenix.com/migrating-small-organization-exchange-2010-exchange-2016-part6/

https://gallery.technet.microsoft.com/office/Exchange-2010-Architecture-9368ff56

https://technet.microsoft.com/en-us/library/bb691354(v=exchg.141)

http://www.telnetport25.com/2011/04/prerequisites-for-installing-exchange-2010-sp1-on-windows-2008-r2/

https://gallery.technet.microsoft.com/office/Install-Exchange-2016-48983e13

https://blogs.technet.microsoft.com/rmilne/2015/03/17/how-to-check-exchange-schema-and-object-values-in-ad/

https://eightwone.com/references/schema-versions/

https://gallery.technet.microsoft.com/scriptcenter/Detect-NET-Framework-120ec923

https://blogs.technet.microsoft.com/exchange/2016/11/04/update-on-windows-server-2016-and-exchange-server-2016/

https://blogs.technet.microsoft.com/exchange/2017/06/13/net-framework-4-7-and-exchange-server/

https://support.microsoft.com/en-us/help/4024204/how-to-temporarily-block-installation-of-the-net-framework-4-7

http://markgossa.blogspot.it/2015/12/exchange-2016-dns-round-robin-load-balancing-part-1.html

https://blogs.technet.microsoft.com/exchange/2010/09/23/default-settings-for-exchange-related-virtual-directories-in-exchange-server-2010/

https://technet.microsoft.com/en-us/library/gg247612(v=exchg.160).aspx

https://social.technet.microsoft.com/wiki/contents/articles/5163.managing-exchange-2010-externalinternal-url-s-via-powershell.aspx

https://technet.microsoft.com/en-us/library/ff629372(v=exchg.141).aspx

http://markgossa.blogspot.it/2015/12/exchange-2016-database-availability-group-part-1.html

http://markgossa.blogspot.it/2015/12/exchange-2016-database-availability-group-troubleshooting-part1.html

http://markgossa.blogspot.it/2015/12/exchange-2016-balance-active-mailbox-databases.html

http://markgossa.blogspot.it/2015/12/exchange-2016-dns-round-robin-load-balancing-part-1.html

https://practical365.com/exchange-server/exchange-server-2013-lagged-database-copies-action/

https://practical365.com/exchange-server/powershell-script-exchange-server-health-check-report/

https://blogs.technet.microsoft.com/exchange/2013/05/23/ambiguous-urls-and-their-effect-on-exchange-2010-to-exchange-2013-migrations/

https://practical365.com/exchange-server/installing-cumulative-updates-on-exchange-server-2016/

https://blogs.technet.microsoft.com/exchange/2012/03/23/demystifying-the-cas-array-object-part-1/

https://blogs.technet.microsoft.com/exchange/2012/03/28/demystifying-the-cas-array-object-part-2/

https://technet.microsoft.com/en-us/library/bb123741(v=exchg.141).aspx

https://technet.microsoft.com/en-us/library/ff808312(v=exchg.160).aspx

https://blogs.technet.microsoft.com/exchange/2015/05/05/exchange-server-2016-architecture/

https://blogs.technet.microsoft.com/exchange/2015/10/12/the-exchange-2016-preferred-architecture/

https://blogs.it.ox.ac.uk/nexus/2014/05/12/mapihttp/

https://blogs.technet.microsoft.com/exchange/2015/10/12/the-exchange-2016-preferred-architecture/

https://blogs.technet.microsoft.com/exchange/2015/10/26/client-connectivity-in-an-exchange-2016-coexistence-environment-with-exchange-2010/

https://practical365.com/exchange-server/exchange-server-2016-migration-preparing-for-coexistence/

https://technet.microsoft.com/en-us/library/bb124904(v=exchg.160).aspx

https://technet.microsoft.com/en-us/library/aa998047(v=exchg.160).aspx

https://technet.microsoft.com/en-us/exdeploy2013/Checklist?state=3229-W-AAAAAAAAQAAAAAEAAAAAAAAAAAAAwAMAAAA%7e

https://docs.microsoft.com/it-it/exchange/high-availability/manage-ha/monitor-dags?view=exchserver-2019

https://blog.myvmx.com/2013/04/exchange-2013-crimson-channel-event-logs.html

https://techgenix.com/exchange-2013-crimson-channel-event-logs/

=========================================================================

mercoledì 15 settembre 2021

Microsoft Exchange - esclusioni antivirus

Solo una piccola precisazione su antivirus e server Exchange. BISOGNA mettere le esclusioni :). E' diventato abbastanza famoso il caso di un antivirus che cancellava l'EDB perche lo riteneva pericoloso :). Credo che li sul momento ci fosse poco da ridere, comunque! In fondo trovate un riferimento all'articolo di Microsoft che aggiunge un po' di spiegazioni, voce per voce. Se possibile, preparate le esclusioni nell'AV PRIMA di installarlo.

PATH

%SystemRoot%\Cluster

%SystemDrive%\DAGFileShareWitnesses\<DAGFQDN>

%ExchangeInstallPath%ClientAccess\OAB

%ExchangeInstallPath%FIP-FS

%ExchangeInstallPath%GroupMetrics

%ExchangeInstallPath%Logging

%ExchangeInstallPath%Mailbox

%ExchangeInstallPath%TransportRoles\Data\Adam

%ExchangeInstallPath%TransportRoles\Data\IpFilter

%ExchangeInstallPath%TransportRoles\Data\Queue

%ExchangeInstallPath%TransportRoles\Data\SenderReputation

%ExchangeInstallPath%TransportRoles\Data\Temp

%ExchangeInstallPath%TransportRoles\Logs

%ExchangeInstallPath%TransportRoles\Pickup

%ExchangeInstallPath%TransportRoles\Replay

%ExchangeInstallPath%UnifiedMessaging\Grammars

%ExchangeInstallPath%UnifiedMessaging\Prompts

%ExchangeInstallPath%UnifiedMessaging\Temp

%ExchangeInstallPath%UnifiedMessaging\Voicemail

%ExchangeInstallPath%Working\OleConverter

%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files

%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\Temporary

%SystemRoot%\System32\Inetsrv

%SystemRoot%\Temp\OICE_<GUID>


PROCESSI


ComplianceAuditService.exe                     %ExchangeInstallPath%Bin

Dsamain.exe                             %SystemRoot%\System32

EdgeTransport.exe                             %ExchangeInstallPath%Bin

fms.exe                             %ExchangeInstallPath%FIP-FS\Bin

hostcontrollerservice.exe                     %ExchangeInstallPath%Bin\Search\Ceres\HostController

inetinfo.exe                             %SystemRoot%\System32\inetsrv

Microsoft.Exchange.AntispamUpdateSvc.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.ContentFilter.Wrapper.exe     %ExchangeInstallPath%TransportRoles\agents\Hygiene

Microsoft.Exchange.Diagnostics.Service.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.Directory.TopologyService.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.EdgeCredentialSvc.exe             %ExchangeInstallPath%Bin

Microsoft.Exchange.EdgeSyncSvc.exe             %ExchangeInstallPath%Bin

Microsoft.Exchange.Imap4.exe             %ExchangeInstallPath%FrontEnd\PopImap

Microsoft.Exchange.Imap4service.exe             %ExchangeInstallPath%ClientAccess\PopImap

Microsoft.Exchange.Notifications.Broker.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.Pop3.exe             %ExchangeInstallPath%FrontEnd\PopImap

Microsoft.Exchange.Pop3service.exe             %ExchangeInstallPath%ClientAccess\PopImap

Microsoft.Exchange.ProtectedServiceHost.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.RPCClientAccess.Service.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.Search.Service.exe     %ExchangeInstallPath%Bin

Microsoft.Exchange.Servicehost.exe             %ExchangeInstallPath%Bin

Microsoft.Exchange.Store.Service.exe             %ExchangeInstallPath%Bin

Microsoft.Exchange.Store.Worker.exe             %ExchangeInstallPath%Bin

Microsoft.Exchange.UM.CallRouter.exe     %ExchangeInstallPath%FrontEnd\CallRouter

MSExchangeCompliance.exe                     %ExchangeInstallPath%Bin

MSExchangeDagMgmt.exe             %ExchangeInstallPath%Bin

MSExchangeDelivery.exe             %ExchangeInstallPath%Bin

MSExchangeFrontendTransport.exe     %ExchangeInstallPath%Bin

MSExchangeHMHost.exe             %ExchangeInstallPath%Bin

MSExchangeHMWorker.exe             %ExchangeInstallPath%Bin

MSExchangeMailboxAssistants.exe     %ExchangeInstallPath%Bin

MSExchangeMailboxReplication.exe             %ExchangeInstallPath%Bin

MSExchangeRepl.exe                     %ExchangeInstallPath%Bin

MSExchangeSubmission.exe                     %ExchangeInstallPath%Bin

MSExchangeTransport.exe             %ExchangeInstallPath%Bin

MSExchangeTransportLogSearch.exe             %ExchangeInstallPath%Bin

MSExchangeThrottling.exe                     %ExchangeInstallPath%Bin

Noderunner.exe                     %ExchangeInstallPath%Bin\Search\Ceres\Runtime\1.0

OleConverter.exe                             %ExchangeInstallPath%Bin

ParserServer.exe                             %ExchangeInstallPath%Bin\Search\Ceres\ParserServer

Powershell.exe                     C:\Windows\System32\WindowsPowerShell\v1.0

ScanEngineTest.exe                     %ExchangeInstallPath%FIP-FS\Bin

ScanningProcess.exe                     %ExchangeInstallPath%FIP-FS\Bin

UmService.exe                     %ExchangeInstallPath%Bin

UmWorkerProcess.exe                     %ExchangeInstallPath%Bin

UpdateService.exe                             %ExchangeInstallPath%FIP-FS\Bin

W3wp.exe                             %SystemRoot%\System32\inetsrv

wsbexchange.exe                     %ExchangeInstallPath%Bin

ESTENSIONI FILES

.chk

.edb

.jfm

.jrs

.log

.que

.dsc

.txt

.cfg

.grxml

.lzx

REFERENCE

https://docs.microsoft.com/it-it/exchange/antispam-and-antimalware/windows-antivirus-software?view=exchserver-2019


mercoledì 3 marzo 2021

Microsoft 365 - Exchange lingua visualizzazione mailbox

Una delle cose che mi capita molto spesso e' che la lingua delle casella postale sia in italiano.

Il modo piu veloce che ho trovato per sistemare e' quello di accedere alla casella di posta tramite Outlook Web. In questo modo, se le impostazioni del nostro utente sono in italiano, i nomi delle cartelle sono mostrati in italiano e non inglese.

Al successivo accesso ad Outlook i nomi delle cartella appariranno nella lingua giusta.

Ad ogni modo sotto trovate un articolo di Microsoft che spiega vari modi per sistemare.


REFERENCE

https://docs.microsoft.com/it-it/outlook/troubleshoot/user-interface/incorrect-folder-names

martedì 6 ottobre 2020

Disjoint name space

 Disjoint name space


Spesso mi sono imbattuto nella domanda se in Ad sono e' in uso un disjoint namespace (soprattutto nella migrazione di Exchange)

Cosa si intende con questa terminologia?


Se il suffisso del nome host e quello di AD sono uguali, non si parla di disjoint namespace.


Alcuni esempi di nomi NON disgiunti:

=====================================================

Dominio AD:

nome netbios: tecnotwo

nome dns: tecnotwo.local


Nomi SERVER:

nome netbios DC1         DC1

nome dns DC1 DC1.tecnotwo.local

nome netbios exchange1:     exchange1

nome dns exchange1:      exchange1.tecnotwo.local

=====================================================


=====================================================

Alcuni esempi di nomi digiunti:

=====================================================

Dominio AD:

nome netbios: tecnotwo

nome dns: tecnotwo.local

Nomi SERVER:

nome netbios DC2         DC2

nome dns DC2 DC2.threepigs.com

nome netbios exchange2: exchange2

nome dns exchange2: exchange2.fourpigs.com

=====================================================

Dominio AD:

nome netbios: codetwenty

nome dns: tecnotwo.local

Nomi SERVER:

nome netbios DCA           DCA

nome dns DCA                 DCA.tecnotwo.local

=====================================================

REFERENCE

https://docs.microsoft.com/en-us/exchange/disjoint-namespace-scenarios-exchange-2013-help




Installazione e configurazione di un certificato in Exchange

 Installazione e configurazione di un certificato in Exchange


Ormai e' praticamente d'obbligo usare certificati SSL validi ed "ufficiali" (non self-signed) per evitare di avere problemi, soprattutto con i dispositivi mobili ed in ambienti ibridi.

Partiamo dal punto in cui abbiamo a disposizione un .pfx da caricare.

Import-ExchangeCertificate -FileData ([Byte[]]$(Get-Content -Path c:\certificates\YOUR_CERTIFICATE.pfx -Encoding byte -ReadCount 0)) -FriendlyName "New_SAN"

Consiglio di usare il parametro friendlyname per poterlo identificare facilmente.

A questo punto il certificato e' disponible in Exchange. Occorre assegnarlo ai servizi.

Enable-ExchangeCertificate -Services "IIS,POP,IMAP,SMTP"

L'assegnazione di un certificato ad un servizio non rimuove automaticamente l'associazione con i precedenti.

Per motivi di "ordine" consiglio di rimuovere questa associazione. Per farlo si puo usare il seguente comando:

Enable-ExchangeCertificate -Services "None" -Thumbprint XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Personalmente ho avuto qualche problema con questo comando, e non sempre ha funzionato.

Ad ogni modo, occorre essere sicuri al 100% prima di cancellare un certificato. Sarebbe bene assicurarsi di poterlo ricaricare in caso di necessita.

Remove-ExchangeCertificate -Thumbprint 5C5E9124B0960BBFB570596AAE6902742D95361E


APPENDICE

Comandi utili per l'interrogazione dei certificati Exchange

Get-ExchangeCertificate | where {$_.IsSelfSigned -match "False"} | fl

Get-ExchangeCertificate | where {$_.IsSelfSigned -match "False" -and $_.Status -match "Valid"} | fl

Get-ExchangeCertificate | where {$_.IsSelfSigned -match "False" -and $_.Status -notmatch "Invalid"} | fl

Get-ExchangeCertificate | where {$_.IsSelfSigned -match "False" -and $_.Status -notmatch "Invalid" -and $_.Issuer -notmatch "CN=XXXX-YYYY-CA"} | fl

Get-ExchangeCertificate | select Thumbprint, Services, NotAfter, Subject, CertificateDomains | where {$_.Services -match "SMTP"} | fl

GESTIONE FRIENDLY NAME TRAMITE GUI

se avete caricato il certificato tramite EMC, potreste voler lo stesso assegnare un nome al certificato. Per farlo occorre cercare il certificato nello store dei certificati della macchina locale ed assegnare ad esso un nome.

mmc-add plugin-certificate-computer-personal

REFERENCE

https://practical365.com/exchange-server/remove-ssl-certificate-exchange-server-2013/

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7

https://stackoverflow.com/questions/24682939/multiple-and-or-in-powershell-where-object-statement

martedì 28 luglio 2020

Exchange Microsoft365 ibrido - Creazione nuovo utente

Nei giorni scorsi mi e' capitato di creare un nuovo utente ed una nuova casella di posta in un ambiente ibrido Exchange/Microsoft365.
Anche se inizialmente sembrava essere andato tutto bene, dopo poco si sono manifestati alcuni problemi.
L'utente nuovo non appariva nella GAL e non riusciva a spedire agli indirizzi on-prem (per fortuna pochi indirizzi).
Analizzando meglio la situazione mi sono reso conto che questo utente esisteva in AD, ma non appariva tra i remote mailbox users in exchange.
Questo rappresentava il nocciolo della questione, ovvero esisteva un utente AD, senza attributi exchange, a cui corrispondeva una casella/utente Office365.
Tutto nasce dal processo che ho seguito per creare l'utente.
In AD ho creato il nuovo utente. Ho sincronizzato AD con AzureAD. Quando e' apparso l'utente anche nella console di amministrazione di Microsoft 365, gli ho assegnato una licenza creando cosi' la mailbox. Ho saltato a pie' pari tutta la parte Exchange on-prem.
Il risultato finale e' stato questo.
La prox volta che creero un nuovo utente, provvedero a crearlo prima on-prem, e quindi ad effettuare un remote-move.
Ma adesso e' necessario sistemare le cose.

Il processo e' abbastanza semplice (basta saperlo!!!). Occorre:
 - recuperare l'ExchangeGUID della casella di posta remota
 - abilitare l'utente AD come mailbox remote user (a seguito di questa operazione l'utente deve apparire nella console di Exchange)
 - associare l'ExchangeGUID al nuovo utente Exchange
 - sincronizzare AD con Azure AD

PASSAGGIO 1
recuperare l'exchange guid della mailbox su Microsoft 365:

get-mailbox -identity p.pippo@disneylanda.it|fl ExchangeGuid

ExchangeGuid : a09ff8fb-26f7-4d81-9425-0c967acfadcd

PASSAGGIO 2
Abilitare l'utente AD come remote mailbox user
Occorre solo abilitare l'utente in Exchange, poiche in AD gia esiste.

Enable-RemoteMailbox p.pippo -RemoteRoutingAddress p.pippo@disneylanda.mail.onmicrosoft.com

A questo punto l'utente deve apparire nell'elnco dei contatti nella GUI di Exchange

PASSAGGIO 3
Associare il corretto ExchangeGUID (recuperato nel passaggio 1) al nuovo utente

Set-RemoteMailbox p.pippo -ExchangeGUID a09ff8fb-26f7-4d81-9425-0c967acfadcd

a09ff8fb-26f7-4d81-9425-0c967acfadcd

PASSAGGIO 4
sincronizzazione AD con AzureAD

Start-ADSyncSyncCycle -PolicyType Delta

adesso potete verificare se funziona la spedizione ad indirizzi on-prem e se l'utente appare nella GAL, quando fate una ricerca.



REFERENCE
https://www.msb365.blog/?p=866

mercoledì 15 luglio 2020

Exchange - cancellazione mailbox database

Nel caso in cui si voglia cancellare un database di posta di Exchange e' necessario spostare tutte le caselle che esso ospita su un altro DB. Soprattutto se il database che volete cancellare e' quello nativo, dovete ricordare di spostare anche le "arbiration mailboxes"
Con il seguente comando e' possibile vedere le caselle di Exchange e su quale DB sono ospitate:
Get-Mailbox |ft name,alias,database

Con il seguente comando, invece, e' possibile vedere le arbitration mailboxes e su quale DB sono ospitate:
Get-Mailbox -arbitration|ft name,alias,database

Con il seguente comando e' possibile spostare le arbitration mailbox su un altro DB
Get-Mailbox -Database "Mailbox Database 1" -arbitration | New-MoveRequest -TargetDatabase "Mailbox Database 2"

Le arbitration mailbox sono tre in Exchange2010 e 5 Exchange 2013/2016. Se cancellate si possono ricreare, ma devono esserci.
Sono usate per vari scopi, come OAB, federazione tra exchange in differenti organizzazioni, moderazione ecc.

Verifica dei database montati
Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted

Smontare il database
Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted
Dismount-Database "Mailbox Database 1" -Confirm:$False

Cancellare il database
Remove-MailboxDatabase "Mailbox Database 1" (da powershell si puo rimuovere il DB senza smontarlo, da GUI bisogna fare i 2 passaggi)



FORMA VELOCE
Spostamento caselle
Get-MailboxDatabase "Mailbox Database 1" |Get-Mailbox |New-MoveRequest -TargetDatabase "Mailbox Database 2" -Confirm:$true
Get-MailboxDatabase "Mailbox Database 1" |Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase "Mailbox Database 2"
Get-MailboxDatabase "Mailbox Database 1" |Get-Mailbox -Monitoring | New-MoveRequest -TargetDatabase "Mailbox Database 2" (exchange2013 in poi)
MONITORAGGIO SPOSTAMENTO
Get-MoveRequest
Get-MoveRequestStatistic
CANCELLAZIONE
Remove-MailboxDatabase "Mailbox Database 1"


P.S.
se prima di cancellare il DB lo tenete smontato per un po potrebbe essere necessario disabilitare l'indicizzazione verso quel DB. Per farlo e sufficiente usare il seguente comando:

Get-MailboxDatabase -identity "mailbox database" -IndexEnable $false

e riavviare il servizio di ricerca di Exchange.



REFERENCE
https://docs.microsoft.com/en-us/exchange/recreating-arbitration-mailboxes-exchange-2013-help
http://techgenix.com/what-are-arbitration-mailboxes-used/
http://www.thatlazyadmin.com/2191-2/



mercoledì 29 gennaio 2020

Esportazione elenco indirizzi Exchange

Esportazione di tutti gli indirizzi di posta di Exchange, alias compresi.
Durante una migrazione di Exchange puo essere utile sapere tutti gli indirizzi di posta utilizzati, eventuali alias compresi.

Get-Recipient -resultsize unlimited | Select DisplayName, RecipientType, EmailAddresses
MAILBOX ONLY
Get-Mailbox | Select UserPrincipalName,EmailAddresses

A questo punto potrebbe essere utile esportarli in un file CSV.

Get-Recipient -resultsize unlimited | Select DisplayName, RecipientType, EmailAddresses | Export-Csv C:\Temp\Addresses.csv

Quando visualizzo il file, nel campo email address, anziche gli indirizzi trovo il seguente valore:

”Microsoft.Exchange.Data.ProxyAddressCollection”

Tutte le righe erano esportate correttamente tranne quella degli indirizzi di posta. A video, invece, nessun problema.

Il motivo per cui accade questo e' perche il campo email address e' un valore multiplo.
Per risolvere e' necessario ricorrere ad un piccolo trucchetto. Al posto di emailadresses usare:
@{Name='EmailAddresses'; Expression={$_.EmailAddresses -join ","}}

Get-Recipient -resultsize unlimited | Select DisplayName, RecipientType, @{Name='EmailAddresses'; Expression={$_.EmailAddresses -join ","}} | Export-Csv C:\Temp\Addresses.csv

MAILBOX ONLY
Get-Mailbox | Select UserPrincipalName, @{Name='EmailAddresses'; Expression={$_.EmailAddresses -join ","}} | Export-Csv C:\Temp\Addresses.csv

La differenza tra get-recipient include tutti gli indirizzi (mailbox, dl ecc. ecc.)
p.s. non sono certo se include anche i pf mail enabled, ma dovrebbe. Non ho avuto modo di provare

REFERENCE
https://jaapwesselius.com/2014/12/11/export-email-addresses-in-exchange-2013/
eightwone.com