210 likes | 487 Views
Nathan Winters – MVP Exchange Server Alistair Keay – Lead Consultant. Configuring OCS and Exchange. Agenda. Exchange Configuration PowerShell and Exchange basics Common uses of EMS Deploying Exchange from the CMD line Preparing for OCS DNS Records Setting up your Edge
E N D
Nathan Winters – MVP Exchange Server Alistair Keay – Lead Consultant Configuring OCS and Exchange
Agenda • Exchange Configuration • PowerShell and Exchange basics • Common uses of EMS • Deploying Exchange from the CMD line • Preparing for OCS • DNS Records • Setting up your Edge • Firewall configuration • Certificates and OCS • Do you need a Director – What does it do? • Microsoft Voice Integration • Various OCS specific scenarios • A look at response groups • Investigating group chat • Create a CWA virtual directory • Configure dial in conferencing • Setup delegation
If you’re new to PowerShell • Exchange 2007 based on PowerShell • Exchange 2007 adds to Windows PowerShell – 394 cmdlets (EMS) • Cmdlet is simply a verb-noun combination • Get-ExCommand • Set-Mailbox • Remove-MailboxDatabase
If you’re new to PowerShell #2 • Parameters – Being specific • Get-ExchangeServer –Identity Exch2007 • Optional and Mandatory parameters • Enable-Mailbox –Database DB1 • Pipeline – How to make things even more effective • Get-Mailbox | Measure-Object
If you’re new to PowerShell #3 • Formating output • Format-List (fl) • Format-Table (ft) • Selecting from results • Get-MailboxStatistics | where-object {$_.LastLogonTime -lt '10/13/2008'} | sort-object DatabaseName, TotalItemSize,LastLogonTime | format-table DisplayName, TotalItemSize, LastLogonTime, DatabaseName • Getting output into a text file • Get-Mailbox | Out-File c:\mailboxlist.txt
Common Uses of EMS • Certificate Setup • Export/Import Mailboxes • Public Folder Permissions • Setup and management of SCR • Getting Mailbox Statistics • Upgrading Address lists
Deploying Exchange from the CMD line #1 • Prerequisites • ServerManagerCmd -i PowerShell • ServerManagerCmd -i Web-Server • ServerManagerCmd -i Web-ISAPI-Ext • ServerManagerCmd -i Web-Metabase • ServerManagerCmd -i Web-Lgcy-Mgmt-Console • ServerManagerCmd -i Web-Basic-Auth • ServerManagerCmd -i Web-Digest-Auth • ServerManagerCmd -i Web-Windows-Auth • ServerManagerCmd -i Web-Dyn-Compression • ServerManagerCmd -i RPC-over-HTTP-proxy
Deploying Exchange from the CMD line #2 • Prepare AD • Setup.com /PrepareAD • Setup.com /PrepareAllDomains • Enable the ability to run scripts on the server • Set-ExecutionPolicy RemoteSigned • Install • New-Item -Type directory -Path "C:\Program Files\Microsoft\Exchange Server“ • C:\software\exchange2007\Setup.com /mode:install /roles:"ClientAccess,HubTransport,Mailbox" /TargetDir:"C:\Program Files\Microsoft\Exchange Server" /SourceDir:C:\Software\Exchange2007 /EnableErrorReporting /LegacyRoutingServer:Exch2003.child.gaots.co.uk /UpdatesDir:C:\Software\Exchange2007Patches
Deploying Exchange from the CMD line #3 • Check Setup • Get-SetupLog c:\exchangesetuplogs\exchangesetup.log - error -tree • Get-ExchangeServer • Enter the License Key • Set-ExchangeServer -Identity Exch2007 -ProductKey 12345-12345-12345-12345-12345 • Restart-Service MSExchangeIS
Deploying Exchange from the CMD line #4 • Update DatabaseMaxCache setting in Transport service DB • (Get-Content "C:\Program Files\Microsoft\Exchange Server\Bin\EdgeTransport.exe.config") | Foreach-Object {$_ -replace "134217728", "536870912"} | Set-Content "C:\Program Files\Microsoft\Exchange Server\Bin\EdgeTransport.exe.config" • Restart-Service MSExchangeTransport
Deploying Exchange from the CMD line #5 • Routing Configuration for larger networks • Get-RoutingGroupConnector | where {($_.sourceroutinggroup -eq "Exchange Routing Group (DWBGZMFD01QNBJR)") -or ($_.targetroutinggroup -eq "Exchange Routing Group (DWBGZMFD01QNBJR)")} | Remove-RoutingGroupConnector -Confirm:$false • Create new routing group connectors • New-RoutingGroupConnector -Name "New York 2003-2007" -SourceTransportServers "NYC-Exch2007.gaots.co.uk” -TargetTransportServers "NYC-Exch2003.gaots.co.uk" -Bidirectional:$true -Cost 10
Deploying Exchange from the CMD line #6 • Setup a relay connector • New-ReceiveConnector -Name “Internal SMTP Relay” -Usage Custom -Bindings 192.168.200.134:25, 192.168.200.134:587 -Fqdn LDN-ECA-LB.domain.com -RemoteIPRanges 192.168.6.25, 172.16.1.12, -Server LDN-ECA-01 –AuthMechanism TLS, ExternalAuthoritative –PermissionGroupsExchangeServers –MaxMessageSize 50MB
Deploying Exchange from the CMD line #7 • Certificate names: • Common Name=Mail-LDN.domain.com • Mail-LDN.domain.com • LDN-ECA-01 • LDN-ECA-02 • Autodiscover.domain.com • LDN-ECA-01.domain.com • LDN-ECA-02.domain.com
Deploying Exchange from the CMD line #8 • Create a request for a certificate • New-ExchangeCertificate -GenerateRequest -Path c:\Mail-LDN_domain_com.csr -KeySize 2048 -SubjectName "c=GB, s=London, l=London, o=Company PLC, ou=ICT Department, cn=Mail-LDN.domain.com" -DomainName Mail-LDN.domain.com, LDN-ECA-01, LDN-ECA-02, Autodiscover.domain.com, LDN-ECA-01.domain.com, LDN-ECA-02.domain.com -PrivateKeyExportable $True
Deploying Exchange from the CMD line #9 • Export and copy to second server • Get-ExchangeCertificate | where {$_.services -eq "IMAP, POP, IIS, SMTP"} | export-exchangecertificate -path \\SecondServer\c$\OWAcas-cert.pfx -binaryencoded:$true -password:(Get-Credential).password • Import and enable the certificate • Import-ExchangeCertificate -path c:\DCcas-cert.pfx -Password:(Get-Credential).password | Enable-ExchangeCertificate -Services "IIS,SMTP,POP,IMAP"
Deploying Exchange from the CMD line #10 Setting Web URLs • Set-WebServicesVirtualDirectory -Identity LDN-ECA-01\"EWS (Default Web Site)" -ExternalUrl https://mail-ldn.domain.com/ews/exchange.asmx • Set-OabVirtualDirectory -Identity LDN-ECA-01\"OAB (Default Web Site)" -ExternalUrl https://mail-ldn.domain.com/OAB -RequireSSL:$True • Set-UMVirtualDirectory -Identity LDN-ECA-01\"UnifiedMessaging (Default Web Site)" -ExternalUrl https://mail-ldn.domain.com/unifiedmessaging/service.asmx • Set-OWAVirtualDirectory -Identity LDN-ECA-01\"OWA (Default Web Site)" -ExternalUrl https://mail-ldn.domain.com/owa • Set-ActiveSyncVirtualDirectory -Identity “LDN-ECA-01\Microsoft-Server-ActiveSync (Default Web Site)” -ExternalURL https://mail-ldn.domain.com/Microsoft-Server-Activesync
Deploying Exchange from the CMD line #11 • Delete Existing Storage Groups and Databases • Get-MailboxDatabase -Server "Exch2007" | Dismount-Database -Confirm:$false • Get-MailboxDatabase -Server "Exch2007" | Remove-MailboxDatabase -Confirm:$false • Get-PublicFolderDatabase -Server "Exch2007" | Dismount-Database -Confirm:$false • $PFD = [ADSI]"LDAP://CN=Public Folder Database,CN=Second Storage Group,CN=InformationStore,CN=EXCH2007,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=GaotsOrg,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=gaots,DC=co,DC=uk" • $PFD.DeleteObject(0) • Get-StorageGroup -Server "Exch2007" | Remove-StorageGroup -Confirm:$false
Deploying Exchange from the CMD line #12 • Create journal mailbox • New-Mailbox -Name 'journal' -Alias 'journal' -OrganizationalUnit 'child.gaots.co.uk/Users' -UserPrincipalName 'journal@child.gaots.co.uk' -SamAccountName 'journal' -FirstName 'journal' -Initials '' -LastName '' -Password 'System.Security.SecureString' -ResetPasswordOnNextLogon $false -Database 'EXCH2007\SG-MBD-01\MBD-01‘ • Configure Mailbox Database • Set-MailboxDatabase -Identity MBD-01 -DeletedItemRetention 21.00:00:00 -JournalRecipient journal@clarinathan.co.uk -MaintenanceSchedule "0.22:00-1.00:00","1.22:00-2.00:00","2.22:00-3.00:00","3.22:00-4.00:00","4.22:00-5.00:00","5.22:00-6.00:00","6.22:00-0.00:00" -RetainDeletedItemsUntilBackup:$true -ProhibitSendQuota unlimited -ProhibitSendReceiveQuota unlimited -IssueWarningQuota unlimited -MailboxRetention 30.00:00:00 -PublicFolderDatabase Exch2007\SG-PFD-01\PFD-01 -OfflineAddressBook "Default Offline Address List"
Deploying Exchange from the CMD line #13 • Public Folders – Edit AddReplicaToPFRecursive ----- if ($server) { $getpfcmd = "get-publicfolder -server $Server -identity '$TopPublicFolder' -Recurse -resultsize unlimited" } else { $getpfcmd = "get-publicfolder -identity '$TopPublicFolder' -Recurse -resultsize unlimited" } ----- • Add Replicas • .\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree\OFFLINE ADDRESS BOOK" -ServerToAdd Exch2007 • .\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree\SCHEDULE+ FREE BUSY" -ServerToAdd Exch2007
Further Reading! If you want a single book to help you dive into managing Exchange with PowerShell then this is it.
Questions • If you have questions let’s hear them.... • If there is no time, then contact me: • nathan@clarinathan.co.uk • http://www.mmmug.co.uk