Exchange 2019 Lab

Estuve realizando la investigación de los requerimientos para poder implementar Exchange server 2019, los requisitos de software no son gran cosa, windows Server 2019 con o sin interfaz gráfica, .Net 4.7.2, el componente redistribuible de Visual C++, y el complemento de Unified Comunications (que esta dentro del ISO del instalador de exchange). sin embargo los requerimientos de Hardware si son mas exclusivos, pues pide 2 procesadores x64 *intel o AMD, y 128 GB de memoria RAM, mas un espacio en disco de 30GB para los binarios, mas el espacio que dediques para la base de datos, idealmente en un disco aparte. así que esto me llevo a utilizar mi ya quemada suscripción de Azure, para probar este escenario, y resulte encontrando esta joya de hipervinculo https://docs.microsoft.com/en-us/Exchange/plan-and-deploy/deploy-new-installations/create-azure-test-environments?view=exchserver-2019 donde paso a paso hay un script de Powershell que crea un escenario de laboratorio, desplegando un controlador de dominio y un servidor Exchange 2019. Es necesario que instales el modulo AZ para Powershell, y que tengas una suscripción gratuita de Azure para replicar estos pasos

Connect-AzAccount

Get-AZSubscription | Sort SubscriptionName | Select SubscriptionName

$subscrName=»Plataformas de MSDN«
Select-AzSubscription -SubscriptionName $subscrName

Get-AZResourceGroup | Sort ResourceGroupName | Select ResourceGroupName

$rgName=»LabExch19«
$locName=»EastUS«
New-AZResourceGroup -Name $rgName -Location $locName

Get-AZStorageAccount | Sort StorageAccountName | Select StorageAccountName

Get-AZStorageAccountNameAvailability «»

$rgName=»LabExch19«
$locName=»EastUS»
$locName=(Get-AZResourceGroup -Name $rgName).Location
New-AZStorageAccount -Name $saName -ResourceGroupName $rgName -Type Standard_LRS -Location $locName

$rgName=»LabExch19»
$locName=(Get-AZResourceGroup -Name $rgName).Location
$Subnet=New-AZVirtualNetworkSubnetConfig -Name Subnet01 -AddressPrefix 10.0.0.0/27
New-AZVirtualNetwork -Name Vnet01 -ResourceGroupName $rgName -Location $locName -AddressPrefix 10.0.0.0/24 -Subnet $Subnet -DNSServer 10.0.0.4
$rule1 = New-AZNetworkSecurityRuleConfig -Name «RDPTraffic» -Description «Allow RDP to all VMs on the subnet» -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389
$rule2 = New-AZNetworkSecurityRuleConfig -Name «ExchangeSecureWebTraffic» -Description «Allow HTTPS to the Exchange server» -Access Allow -Protocol Tcp -Direction Inbound -Priority 101 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix «10.0.0.5/32» -DestinationPortRange 443
New-AZNetworkSecurityGroup -Name Subnet01 -ResourceGroupName $rgName -Location $locName -SecurityRules $rule1, $rule2
$vnet=Get-AZVirtualNetwork -ResourceGroupName $rgName -Name Vnet01
$nsg=Get-AZNetworkSecurityGroup -Name Subnet01 -ResourceGroupName $rgName
Set-AZVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name Subnet01 -AddressPrefix «10.0.0.0/27» -NetworkSecurityGroup $nsg
$vnet | Set-AzVirtualNetwork

$rgName=»LabExch19»

Create an availability set for domain controller virtual machines

New-AZAvailabilitySet -ResourceGroupName $rgName -Name dcAvailabilitySet -Location $locName -Sku Aligned -PlatformUpdateDomainCount 5 -PlatformFaultDomainCount 2

Create the domain controller virtual machine

$vnet=Get-AZVirtualNetwork -Name Vnet01 -ResourceGroupName $rgName
$pip = New-AZPublicIpAddress -Name adVM-NIC -ResourceGroupName $rgName -Location $locName -AllocationMethod Dynamic
$nic = New-AZNetworkInterface -Name adVM-NIC -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -PrivateIpAddress 10.0.0.4
$avSet=Get-AZAvailabilitySet -Name dcAvailabilitySet -ResourceGroupName $rgName
$vm=New-AZVMConfig -VMName adVM -VMSize Standard_D1_v2 -AvailabilitySetId $avSet.Id
$vm=Set-AZVMOSDisk -VM $vm -Name adVM-OS -DiskSizeInGB 128 -CreateOption FromImage -StorageAccountType «Standard_LRS»
$diskConfig=New-AZDiskConfig -AccountType «Standard_LRS» -Location $locName -CreateOption Empty -DiskSizeGB 20
$dataDisk1=New-AZDisk -DiskName adVM-DataDisk1 -Disk $diskConfig -ResourceGroupName $rgName
$vm=Add-AZVMDataDisk -VM $vm -Name adVM-DataDisk1 -CreateOption Attach -ManagedDiskId $dataDisk1.Id -Lun 1
$cred=Get-Credential -Message «Type the name and password of the local administrator account for adVM.»
$vm=Set-AZVMOperatingSystem -VM $vm -Windows -ComputerName adVM -Credential $cred -ProvisionVMAgent -EnableAutoUpdate
$vm=Set-AZVMSourceImage -VM $vm -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2019-Datacenter -Version «latest»
$vm=Add-AZVMNetworkInterface -VM $vm -Id $nic.Id
New-AZVM -ResourceGroupName $rgName -Location $locName -VM $vm

conecte al adVM y ejecute

$disk=Get-Disk | where {$_.PartitionStyle -eq «RAW»}
$diskNumber=$disk.Number
Initialize-Disk -Number $diskNumber
New-Partition -DiskNumber $diskNumber -UseMaximumSize -AssignDriveLetter
Format-Volume -DriveLetter F

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
Install-ADDSForest -DomainName CampoHenriquez.com -DatabasePath «F:\NTDS» -SysvolPath «F:\SYSVOL» -LogPath «F:\Logs»

Add-WindowsFeature RSAT-ADDS-Tools

Creamos ahora la maquina de Exchange

$vmDNSName=»Mail01Exch19«
$rgName=»LabExch19»
$locName=(Get-AZResourceGroup -Name $rgName).Location
Test-AZDnsAvailability -DomainQualifiedName $vmDNSName -Location $locName

Set up key variables

$subscrName=»Plataformas de MSDN«
$rgName=»LabExch19»
$vmDNSName= «Mail01Exch19»

Set the Azure subscription

Select-AzSubscription -SubscriptionName $subscrName

Get the Azure location and storage account names

$locName=(Get-AZResourceGroup -Name $rgName).Location
$saName=(Get-AZStorageaccount | Where {$_.ResourceGroupName -eq $rgName}).StorageAccountName

Create an availability set for Exchange virtual machines

New-AZAvailabilitySet -ResourceGroupName $rgName -Name exAvailabilitySet -Location $locName -Sku Aligned -PlatformUpdateDomainCount 5 -PlatformFaultDomainCount 2

Specify the virtual machine name and size

$vmName=»Mail01Exch19»
$vmSize=»Standard_D3_v2″
$vnet=Get-AZVirtualNetwork -Name Vnet01 -ResourceGroupName $rgName
$avSet=Get-AZAvailabilitySet -Name exAvailabilitySet -ResourceGroupName $rgName
$vm=New-AZVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avSet.Id

Create the NIC for the virtual machine

$nicName=$vmName + «-NIC»
$pipName=$vmName + «-PublicIP»
$pip=New-AZPublicIpAddress -Name $pipName -ResourceGroupName $rgName -DomainNameLabel $vmDNSName -Location $locName -AllocationMethod Dynamic
$nic=New-AZNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -PrivateIpAddress «10.0.0.5»

Create and configure the virtual machine

$cred=Get-Credential -Message «Type the name and password of the local administrator account for exVM.»
$vm=Set-AZVMOSDisk -VM $vm -Name ($vmName +»-OS») -DiskSizeInGB 128 -CreateOption FromImage -StorageAccountType «Standard_LRS»
$vm=Set-AZVMOperatingSystem -VM $vm -Windows -ComputerName $vmName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate
$vm=Set-AZVMSourceImage -VM $vm -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2019-Datacenter -Version «latest»
$vm=Add-AZVMNetworkInterface -VM $vm -Id $nic.Id
New-AZVM -ResourceGroupName $rgName -Location $locName -VM $vm

Conectese a exVM y ejecute

Add-Computer -DomainName «Campohenriquez.com»
Install-WindowsFeature NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, 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-Tools
Restart-Computer

Fase 3> Configurar el Exchange

Write-Host (Get-AZPublicIpaddress -Name «exVM-PublicIP» -ResourceGroup $rgName).DnsSettings.Fqdn

Desde exVM

descarga los pre-requisitos, Visual C++ redis, UC Managed API https://www.microsoft.com/download/details.aspx?id=34992 y el .Net 4.7.2

descarga el ISO de Exchange con el ultimo CU

e:
.\setup.exe /mode:Install /role:Mailbox /OrganizationName:CampoHenriquez /IacceptExchangeServerLicenseTerms
Restart-Computer

$dnsName=»»
$user1Name=»chris@» + $dnsName
$user2Name=»janet@» + $dnsName
$db=Get-MailboxDatabase
$dbName=$db.Name
$password = Read-Host «Enter password» -AsSecureString

New-Mailbox -UserPrincipalName $user1Name -Alias chris -Database $dbName -Name ChrisAshton -OrganizationalUnit Users -Password $password -FirstName Chris -LastName Ashton -DisplayName «Chris Ashton»
New-Mailbox -UserPrincipalName $user2Name -Alias janet -Database $dbName -Name JanetSchorr -OrganizationalUnit Users -Password $password -FirstName Janet -LastName Schorr -DisplayName «Janet Schorr»

Detener / Iniciar las maquinas virtuales

$rgName=»»
Stop-AZVM -Name exVM -ResourceGroupName $rgName -Force
Stop-AZVM -Name adVM -ResourceGroupName $rgName -Force

$rgName=»»
Start-AZVM -Name adVM -ResourceGroupName $rgName
Start-AZVM -Name exVM -ResourceGroupName $rgName

Dejar un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *