Installation Exchange Server 2019

PreReq installieren:
Visual C++: https://www.microsoft.com/de-DE/download/details.aspx?id=40784
UC Runtime: https://www.microsoft.com/en-us/download/details.aspx?id=34992

Windows Features per Admin Powershell:
Install-WindowsFeature Server-Media-Foundation, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation, RSAT-ADDS, Server-Media-Foundation


Move DB und Log Files:
Move-DatabasePath -Identity MDB01 -EdbFilePath E:\Exchange\DB\MDB01.edb
Move-DatabasePath -Identity MDB01 -LogFolderPath E:\Exchange\Log

Internet Connector erstellen
Accepted Domains
AdressPolicy setzen


Virtual Directories setzen:

$servername= "FWEX2"$internalhostname= "outlook.frankysweb.de"$externalhostname= "outlook.frankysweb.de"$autodiscoverhostname= "autodiscover.frankysweb.de"$owainturl= "https://"+ "$internalhostname"+ "/owa"$owaexturl= "https://"+ "$externalhostname"+ "/owa"$ecpinturl= "https://"+ "$internalhostname"+ "/ecp"$ecpexturl= "https://"+ "$externalhostname"+ "/ecp"$ewsinturl= "https://"+ "$internalhostname"+ "/EWS/Exchange.asmx"$ewsexturl= "https://"+ "$externalhostname"+ "/EWS/Exchange.asmx"$easinturl= "https://"+ "$internalhostname"+ "/Microsoft-Server-ActiveSync"$easexturl= "https://"+ "$externalhostname"+ "/Microsoft-Server-ActiveSync"$oabinturl= "https://"+ "$internalhostname"+ "/OAB"$oabexturl= "https://"+ "$externalhostname"+ "/OAB"$mapiinturl= "https://"+ "$internalhostname"+ "/mapi"$mapiexturl= "https://"+ "$externalhostname"+ "/mapi"$aduri= "https://"+ "$autodiscoverhostname"+ "/Autodiscover/Autodiscover.xml"Get-OwaVirtualDirectory-Server$servername| Set-OwaVirtualDirectory-internalurl$owainturl-externalurl$owaexturlGet-EcpVirtualDirectory-server$servername| Set-EcpVirtualDirectory-internalurl$ecpinturl-externalurl$ecpexturlGet-WebServicesVirtualDirectory-server$servername| Set-WebServicesVirtualDirectory-internalurl$ewsinturl-externalurl$ewsexturlGet-ActiveSyncVirtualDirectory-Server$servername| Set-ActiveSyncVirtualDirectory-internalurl$easinturl-externalurl$easexturlGet-OabVirtualDirectory-Server$servername| Set-OabVirtualDirectory-internalurl$oabinturl-externalurl$oabexturlGet-MapiVirtualDirectory-Server$servername| Set-MapiVirtualDirectory-externalurl$mapiexturl-internalurl$mapiinturlGet-OutlookAnywhere-Server$servername| Set-OutlookAnywhere-externalhostname$externalhostname-internalhostname$internalhostname-ExternalClientsRequireSsl:$true-InternalClientsRequireSsl:$true-ExternalClientAuthenticationMethod'Negotiate'Get-ClientAccessService$servername| Set-ClientAccessService-AutoDiscoverServiceInternalUri$aduriGet-OwaVirtualDirectory-Server$servername| fl server,externalurl,internalurlGet-EcpVirtualDirectory-server$servername| fl server,externalurl,internalurlGet-WebServicesVirtualDirectory-server$servername| fl server,externalurl,internalurlGet-ActiveSyncVirtualDirectory-Server$servername| fl server,externalurl,internalurlGet-OabVirtualDirectory-Server$servername| fl server,externalurl,internalurlGet-MapiVirtualDirectory-Server$servername| fl server,externalurl,internalurlGet-OutlookAnywhere-Server$servername| fl servername,ExternalHostname,InternalHostnameGet-ClientAccessServer$servername| fl name,AutoDiscoverServiceInternalUri






Wichtige Konsolen

certlm.msc Zertifikate vom lokalen Computeraccount
certmgr.msc Zertifikate vom Benutzeraccount
compmgmt.msc Computerverwaltung
services.msc Dienste vom lokalen Computer
devmgmt.msc Gerätemanager
diskmgmt.msc Datenträgerverwaltung
eventvwr.msc Eventviewer
lusrmgr.msc Lokale Benutzerverwaltung
taskschd.msc Taskscheduler
virtmgmt.msc HyperV Management
wf.msc Windowsfirewall

FSMO Rollen

I`ll show you two quick ways to check FSMO roles on Windows 2003 server.

1. open command line and type :
netdom query fsmo
2. copy this code to notepad and save as fsmo.vbs script :
Set objRootDSE = GetObject(”LDAP://rootDSE”)
Set objSchema = GetObject _
(”LDAP://” & objRootDSE.Get(”schemaNamingContext”))
strSchemaMaster = objSchema.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strSchemaMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Schema Master FSMO: ” & objComputer.Name

Set objNtds = Nothing
Set objComputer = Nothing

Set objPartitions = GetObject(”LDAP://CN=Partitions,” & _
objRootDSE.Get(”configurationNamingContext”))
strDomainNamingMaster = objPartitions.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strDomainNamingMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Domain Naming Master FSMO: ” & objComputer.Name

Set objDomain = GetObject _
(”LDAP://” & objRootDSE.Get(”defaultNamingContext”))
strPdcEmulator = objDomain.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strPdcEmulator)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s PDC Emulator FSMO: ” & objComputer.Name

Set objRidManager = GetObject(”LDAP://CN=RID Manager$,CN=System,” & _
objRootDSE.Get(”defaultNamingContext”))
strRidMaster = objRidManager.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strRidMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s RID Master FSMO: ” & objComputer.Name

Set objInfrastructure = GetObject(”LDAP://CN=Infrastructure,” & _
objRootDSE.Get(”defaultNamingContext”))
strInfrastructureMaster = objInfrastructure.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strInfrastructureMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s Infrastructure Master FSMO: ” & objComputer.Name

Then open command line and type: cscript fsmo.vbs

Exchange Logfiles

Remove Exchange Log Files:

Remove old Exchange Log Files Artikel

Befehl inkl. Internet Information Service Folder für 14 Tage:

gci ‚C:\Program Files\Microsoft\Exchange Server\V15\Logging‘,’C:\inetpub\logs‘ -Directory | gci -Include ‚*.log‘,’*.blg‘ -Recurse | ? LastWriteTime -lt (Get-Date).AddDays(-14) | Remove-Item

Enable Circular Logging:

Set-MailboxDatabase {Database-Name} -CircularLoggingEnabled $True
net stop "Microsoft Exchange Information Store"
net start "Microsoft Exchange Information Store"

PowerShell Befehle

Verbindung zu Office365:
Install-Module -Name AzureAD
Install-Module MSOnline
$credential = Get-Credential
Connect-MsolService -Credential $credential
Connect-AzureAD -Credential $credential
https://docs.microsoft.com/de-ch/office365/enterprise/powershell/connect-to-office-365-powershell
Office 365 AD Sync Befehle:
Import-Module ADSync
Start-ADSyncSyncCycle -PolicyType Delta
Start-ADSyncSyncCycle -PolicyType Initial
MAC Adresse per Powershell ansehen:
Get-NetAdapter | select name, macaddress | sort macaddress
Send Email per Powershell Command:
Send-MailMessage -SmtpServer IPorMailServerName -To Emailto@xyz.ch -From EmailFrom@xyz.ch -Subject „It`s me Ronald“ -Body „Send a Test Mail“

Windows Zeitserver konfigurieren

How to set Windows Time Service on Windows Server

w32tm /config /manualpeerlist:%DCNAME%.%DOMAIN%.local,ptbtime1.ptb.de,pool.ntp.org,time.windows.com /syncfromflags:manual /reliable:yes /update

Erklärung:
syncfromflags:manual -> heisst: manuelle Peerliste verwenden
reliable:yes -> heisst: yes=er selber dient als Zeitsource Server no=kein Zeitsource Server