Monday, November 12, 2018

Office 365 Hybrid Deployment with Exchange 2016

A hybrid deployment offers organizations the ability to extend the feature-rich experience and administrative control they have with their existing on-premises Microsoft Exchange organization to the cloud. A hybrid deployment provides the seamless look and feel of a single Exchange organization between an on-premises Exchange organization and Exchange Online in Microsoft Office 365.


Exchange hybrid deployment featureshttps://docs.microsoft.com/en-us/exchange/exchange-hybrid#exchange-hybrid-deployment-features

A hybrid deployment enables the following features:
  • Secure mail routing between on-premises and Exchange Online organizations.
  • Mail routing with a shared domain namespace. For example, both on-premises and Exchange Online organizations use the @domain.com SMTP domain.
  • A unified global address list (GAL), also called a "shared address book."
  • Free/busy and calendar sharing between on-premises and Exchange Online organizations.
  • Centralized control of inbound and outbound mail flow. You can configure all inbound and outbound Exchange Online messages to be routed through the on-premises Exchange organization.
  • A single Outlook on the web URL for both the on-premises and Exchange Online organizations.
  • The ability to move existing on-premises mailboxes to the Exchange Online organization. Exchange Online mailboxes can also be moved back to the on-premises organization if needed.
  • Centralized mailbox management using the on-premises Exchange admin center (EAC).
  • Message tracking, MailTips, and multi-mailbox search between on-premises and Exchange Online organizations.
  • Cloud-based message archiving for on-premises Exchange mailboxes. Exchange Online Archiving can be used with a hybrid deployment.

A hybrid deployment involves several different services and components:
  • Exchange 2016 Servers-   The Exchange 2016 Mailbox server role is required in your on-premises Exchange organization. All on-premises
    Exchange 2016 servers need to have the latest release of Exchange 2016, or the release immediately prior to the current release, installed to support hybrid functionality with Office 365.
  • Office 365-   Hybrid deployments are supported with Office 365 Enterprise, Government and Academic plans.
  • Hybrid Configuration wizard-   Exchange 2016 includes the Hybrid Configuration wizard which provides you with a streamlined process to
    configure a hybrid deployment between on-premises Exchange and Exchange Online organizations.
  • Azure AD authentication system-   The Azure Active Directory (AD) authentication system is a free cloud-based service that acts as the trust broker between your on-premises Exchange 2016 organization and the Exchange Online organization. On-premises organizations configuring a hybrid deployment must have a federation trust with the Azure AD authentication system.
  • The Hybrid Configuration wizard as part of configuring a hybrid
    deployment creates the federation trust. A federation trust with the Azure AD authentication system for your Office 365 tenant is automatically configured when you activate your Office 365 service account.
  • Azure Active Directory synchronization-   Azure AD synchronization uses Azure AD Connect to replicate on-premises Active Directory information for mail-enabled objects to the Office 365 organization to support the unified global address list (GAL) and user authentication.
    Organizations configuring a hybrid deployment need to deploy Azure AD Connect
    on a separate, on-premises server to synchronize your on-premises Active Directory with Office 365.
  • Active Directory Federation Services- AD FS provides simplified, secured identity federation and Web single sign-on (SSO) capabilities for end users who want to access applications within an AD FS-secured enterprise, in federation partner organizations, or in the cloud.
  • Web Application Proxy Server- The Web Application Proxy under the Remote Access role that allows administrators to securely publish applications for external access. This service acts as a reverse proxy and as an Active Directory Federation Services (AD FS) proxy.

Hybrid infrastructure
  • Following components are required to configure hybrid.

Exchange Server 2016 with Mailbox Role
EXCH2016
Exchange Server 2016 with Edge Transport Role
EXCH2016EDGE
Windows Server 2016 with Azure Active Directory Connect (AAD Connect) Installed
AADCONNECT
Active Directory Federation Server(s)
ADFS2016
Web Application Proxy Server in perimeter
EDGE2016
Domain Controller running on minimum Windows Server 2008 R2
DC01
Office 365 Subscriptions with default domain configured i.e. Service tenant FQDN
A.    Domain.onmicrosoft.com
Accepted Domain in Office 365 and On-premises
A.    Domain.com
On-premises domain type
Authoritative
Office 365 Domain Type
Internal Relay
User principal name domain and Microsoft Online ID domain
@domain.com
External Azure AD Connect with AD FS FQDN
a.      sts.domain.com
On-premises Autodiscover FQDN
A.    Autodiscover.domain.com
Office 365 Autodiscover
A.    Autodiscover.outlook.com
  • Configuring Hybrid Exchange Server


Step1: Add and validate primary Email domain to Office 365
Step2: Setup Primary SMTP Domain to Internal Relay
Step3: Configure Active Directory synchronization
Step4: Create Federation with Azure Active Directory
Step5: Verify tenant configuration
Step6: Install Edge Transport server
Step7: Configure Edge servers
Step8: Configure DNS
Step9: Firewall Configuration
Step10: Configure Exchange Web Services
Step11: Configure MRS Proxy
Step12: Configure Exchange certificates
Step13: Run Hybrid Configuration wizard
Step14: Send Connector and Receive Connector Configuration on the on-premises server
Step14: Create a test mailbox
Step15: Move or create mailboxes
Step16: Test hybrid deployment connectivity

Friday, May 25, 2018

DL-members-export script


Get-ADGroupMember -Identity "GroupName" | Get-ADUser -Properties Displayname,Emailaddress,Title |Select samAccountName,Displayname,EmailAddress,Title

Get-DistributionGroup DLname@domain.com | select Displayname, Primarysmtpaddress |Export-CSV c:\DLMembersList.csv

Get-DistributionGroup -Identity DLNAME | Get-DistributionGroupMember |Select Displayname, primarysmtpaddress,name |Export-CSV c:\Members.csv

import-csv C:\user.csv | foreach-object {Get-Mailbox -Identity $_.name | select Displayname, Primarysmtpaddress |Export-CSV c:\UserEmail.csv

 Get-ADGroupMember -Identity  "GroupName" | select Samaccountname,Displayname,name

Get-ADGroupMember -Identity "GroupName" |Select samAccountName,Name,@{Name="DisplayName";Expression={(Get-ADUser $_.distinguishedName Properties Displayname).Displayname}},@{Name="Title";Expression={(Get-ADUser $_.distinguishedName -Properties Title).title}}

Get-Mailbox -Identity  MailboxName | select Displayname, Primarysmtpaddress

Get-ADGroupMember -Identity "GroupName" | Get-ADUser -Properties Displayname,Title |Select samAccountName,Name,Displayname,Primarysmtpaddress,Title


Get Message tracking


Import-csv c:\slist.csv | foreach-object {Get-MessageTrackingLog -server $_.Name -Sender "sendername@domain.com"  -start "12/12/2016 01:00AM" -End "06/12/2016 2:00PM" |Select-Object Recipients, Sender, Timestamp, MessageSubject, MessageId, EventId } | Export-CSV c:\tracklog.csv

Import-csv c:\slist.csv | foreach-object {Get-MessageTrackingLog -server $_.Name -Recipients:sendername@domain.com  -start "06/24/2015 01:00AM" -End "06/26/2015 12:00PM" |Select-Object Recipients, Sender, Timestamp, MessageSubject,EventID} | Export-CSV c:\tracklog.csv

Import-csv c:\slist.csv | foreach-object {Get-MessageTrackingLog -server $_.Name -Recipients:cris.tuft@lpl.com -Sender "Sendername@domain.com" -start "20/10/2015 01:00AM" -End "15/09/2015 23:50PM" | Select-Object Recipients, Sender, Timestamp, MessageSubject} | Export-CSV c:\dispute.csv

Import-csv c:\slist.csv | foreach-object {Get-MessageTrackingLog -server $_.Name -Sender "username@domain.com" -start "10/20/2015 01:00AM" -End "10/20/2015 23:50PM" -MessageSubject “Grade Report Fall 2017” | Select-Object Recipients, Sender, Timestamp, MessageSubject} | Export-CSV c:\tracklog.csv

Get-MessageTrace  -Sender "email@domain.com" -Recipients:email@domain.edu -start “12/12/2017 12:00 AM” -EventID Receive | Select ServerHostName,Timestamp,Recipients

Get-MessageTrace -RecipientAddress <user’s address> -StartDate 11/07/2017 -EndDate 11/14/2017 | Format-list -Property Received,SenderAddress,Status,MessageTraceId

Get-MessageTrace -Sender "email@domain.edu"  -MessageSubject “Grade Report Fall 2017”  -start “01/11/2018 12:00 AM” -End “01/11/2018 11:59 PM”| Get-MessageTraceDetail

Get-MessageTrace StartDate 01/11/2018 -EndDate 01/11/2018 -PageSize 10000 | Where {$_.Subject -like "*Grade Report Fall 201*"} | ft -Wrap

Get-MessageTrace -Sender "email@domain.edu" -start “01/11/2018 8:00 AM” -End “01/11/2018 11:59 PM” |Where {$_.Subject -like "*Grade Report Fall*"} | Format-list -Property Received,SenderAddress,Status,subject >>c:\Mtracklog.txt

Get-TransportServer | get-messagetrackinglog -EventID “RECEIVE” -Start “6/10/2015 2:30:00 PM” -End “6/10/2015 4:00:00 PM” -ResultSize Unlimited | Select EventId,Source,Sender,ServerHostName,{$_.recipients},MessageId,MessageSubject,ClientIp,TimeStamp | Export-Csv “D:\RepCas1\Example.Csv”

Get-TransportServer |Get-MessageTrackingLog -Start (Get-Date).Addhours(-48) `-End (Get-Date) `-EventId send `-Sender “email@domain.com”` | Select-Object Recipients,timestamp,eventid `| Where {($_.Recipients -match ‘@hotmail.com’)}

get-messagetrackinglog -Sender “email@domain.com” -EventID “SEND” -Start “4/5/2014 8:00:00 AM” -End “4/5/2014 12:00:00 PM” | Where-Object {$_.recipients -like “*gmail.com”} | Export-csv C:\export.csv

Get-MessageTrace -Sender "email@domain.edu" -start “01/09/2018 12:00 AM” -End “01/11/201
8 11:59 PM” |Where {$_.Subject -like "*Grade Report Fall*"} | Format-list -Property Received,SenderAddress,Status,subject

Thursday, May 24, 2018

Connect Powershell Session - Exchange


Get-ExecutionPolicy

Set-ExecutionPolicy RemoteSigned

Set-ADServerSettings -ViewEntireForest $true

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver.domain.com/PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session

Get-mailbox -identity Rakesh

Server UPTime Report



Get-ExchangeServer|%{
    if(Test-Connection $_.name -Count 1 -Quiet) {
        $OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $_.name         

        $uptime = (Get-Date) - $OS.ConvertToDateTime($OS.LastBootUpTime)           

        $report += "$($_.name) has been up for {0} days, {1} hours and {2} minutes." `
        -f $uptime.Days, $uptime.Hours, $uptime.Minutes + "`r"
    }
}

Send-MailMessage -To rakesh.chaturvedi@domain.com -From ExchangeServerReport@domain.com -Subject "Exchange Server Uptime" -Body $report -SmtpServer "SMTP-Server.domain.com"

Sunday, March 29, 2015

Patching Procedure and Verification Tests-Exchange

Patching Procedure

1.   Login to the server

2.   For Windows Patching

1.   Go to start à All Programs à Windows Update



             2. Click on the blue where it says numbers of updates are available.



             3. Ensure that there is no Exchange rollup/hotfix/ServicePack, if there is a rollup checked then UNCHECK the Exchange rollup/hotfix/ServicePack

             4. Then Click ok and then click on Install Updates

             5. Once completed click finished and restart the server.
 
            6. Once restart the server again check updates, if it available new update, click Install
           
             7. Once completed click finished and restart the server.
            
              8. Verify the all services running working fine.
 
 
Verification Tests

Run the following tests on all Exchange servers

1.Get-queue | ? {$_.MessageCount –gt 5}

Queue should be less than 10 mails

2.Test-ServiceHealth

No service should show in ServiceNotRunning under any role.

        

                 3. Test-ReplactionHealth

                                         Replication should show Passed for all

                 4. Test-OutlookWebServices

                                         No Error should come except the Id 1104

                 5. Test-Mapiconnectivity

                                         This should come success

                 6. Get-mailboxdatabasecopystatus **

                                         Databases should show healthy and mounted.

                 7. Login to OWA using test account and test send and receive of the email.