Tuesday, 26 March 2013

Managing Distribution List using Shell Command


This post contains the information on how to manage distribution list in Exchange server 2010. In exchange server 2010, only the universal distribution or the security group can be mail enabled. No other scopes like Local or Global Distribution Groups are supported in Exchange Server 2010. Below are the distribution groups that can be created

  • Mail enabled Universal Distribution Group
  • Mail enabled universal Security Group
  • Dynamic Distribution Group

Now we will have a look at some of the topics related to managing distribution list in exchange server 2010.

[important title ="How to create a Distribution Group in Exchange Server 2010"]

New-DistributionGroup -Name “Name of the Distribution Group” -OrganizationalUnit “DomainName.Com/Exchange Distribution Lists” -SAMAccountName “DIstributionGroupAlias” -Type “Distribution” [/important]

[important title ="How to add owner to a distribution group"]

Set-Group -Identity “DL Group Name” -ManagedBy “Domain Name\UserName” [/important]

[important title ="How to add Permission to distribution group for Owner"]

After adding Managedby user on a distribution group, better to give read and write access permission for Owner

Add-ADPermission -Identity “DL Group Name” -User “DomainName\user” -AccessRights ReadProperty, WriteProperty -Properties ‘Member’ [/important]

[important title ="How to change the owner of a distribution group"]

Set-DistributionGroup -Identity “DL Group Name” -ManagedBy “DomainName\NewOwnerUser”

Add-ADPermission -Identity “DL Group Name” -User “DomainName\NewOwnerUser” -AccessRights ReadProperty, WriteProperty -Properties ‘Member’ [/important]

[important title ="How to add a second or additional owner for a distribution group"]

Giving read and write access permission at active directory level will allow the other user to function as a co owner for a Distribution Group

Set-DistributionGroup -ManagedBy ‘New Onwer Name’,'Old Owner Name’ -Identity ‘Distribution Group Name’

Add-ADPermission -Identity “DL Group Name” -User “DomainName\SecondOwner” -AccessRights ReadProperty, WriteProperty -Properties ‘Member’ [/important]

[important title ="How to remove additional owner from a distribution group"]

Remove-ADPermission -Identity “DL Group Name” -User ” DomainName\SecondOwner ” -AccessRights ReadProperty, WriteProperty -Properties ‘Member’ [/important]

[important title ="How to rename a Display name and Alias Name for a Distribution Group"]Set-DistributionGroup -Identity ‘Distribution Group Name’ -DisplayName ‘Enter New Name’ -Alias “New_Alias” [/important]

[important title ="How to export the members list from a Distribution Group"]

Get-DistributionGroupMember -Identity ‘Distribution Group Name” | FL Name [/important]

[important title ="How to add a New Member to the distribution Group"]

Add-DistributionGroupMember -Identity “Distribution Group Name” -Member “UserName’ [/important]

[important title ="How to disable or remove a Distribution Group"]

Disable-DistributionGroup -Identity “Distribution Group Name”

Remove-DistributionGroup -Identity “Distribution Group Name” [/important]

[important title ="How to mail enable or mail disable a security group"]

If we have an active directory security group available and if we want to mail enable that security group, we can use the below shell command and email address will be created for that security group

Enable-DistributionGroup –Identity “DL Display Name”

Disable-DistributionGroup –Identity “DL Display Name” [/important]

[important title ="How to allow external users to send email to the distribution list"]

Set-DistributionGroup -Identity ‘Distribution Group Name’ -RequireSenderAuthenticationEnabled $True [/important]

[important title ="How to allow owners to approve or restrict member to join or to leave a Distribution Group"]

Set-DistributionGroup -MemberJoinRestriction ‘ApprovalRequired’ -MemberDepartRestriction ‘Closed’ -Identity ‘Distribution Group Name’ [/important]

[important title ="How to allow only few users to send email to distribution list"]

Set-DistributionGroup -AcceptMessagesOnlyFromSendersOrMembers ‘User Name 1’,’User Name 2′ -RequireSenderAuthenticationEnabled $True -Identity ‘Distribution Group Name’ [/important]

[important title ="How to restrict few users to send email to distribution list"]

Set-DistributionGroup -AcceptMessagesOnlyFromSendersOrMembers “All Users” -RequireSenderAuthenticationEnabled $True -Identity ‘Distribution Group Name’ -RejectMessagesFromSendersOrMembers ‘User Name 1’,’User Name 2′ [/important]

[important title ="How to set a Message Moderator to allow emails and to bypass approval from few users"]

Set-DistributionGroup -ModerationEnabled $true -ModeratedBy ‘Moderator User Name’ -BypassModerationFromSendersOrMembers ‘User don’t require approval’ -Identity ‘Distribution Group Name’ [/important]

[important title ="How to hide a distribution group from Gloabll Address List"]

Set-DistributionGroup -Identity ‘Distribution Group Name’ -HiddenFromAddressListsEnabled $true[/important]

[important title ="How to add additional email address to a distribution list"]

Set-DistributionGroup -Identity ‘Distribution Group Name’ -EmailAddresses ‘SMTP:existingemailaddress’,'smtp:Newemailaddress’ [/important]

[important title ="How to create a dynamic distribution list"]

New-DynamicDistributionGroup -Name “Name of DDG” -Alias “Alias_Name” -IncludedRecipients “MailboxUsers,MailContacts” -OrganizationalUnit “DomainName.com/Users” -ConditionalDepartment “DepartmentName1″,”DepartmentName2″ -RecipientContainer “DomainName.com” [/important]

If you are having any issue on running the above shell command or any other management task using shell command to be included, kindly leave your comments

 

Exchange Server 2010 Mail Flow diagram

This post will help you to understand how the mail flow happen in exchange server 2010. Having any query leave a comment here.
Email to the Hub Transport Server are submitted in 3 ways, they are
  1. Through SMTP submission,
  2. From the Pickup directory and
  3. When a user inside the organization sends a message
Those emails submitted to the Hub transport server is picked up from the user’s Outbox by the store driver. The store driver is a software component of the Hub Transport server that delivers inbound messages to Exchange stores, the databases that contain public folder and mailbox stores























Messages that are sent by users in your organization are picked up from the sender’s Outbox by the store driver and are put in the Submission queue on a server that runs the Hub Transport server role. When messages are submitted to the Hub Transport server, they’re processed by the categorizer.

Categoriser: The categorizer is a component of Exchange transport that processes all inbound messages and determines what to do with the messages based on information about the intended recipients.

In Exchange 2010, the Hub Transport server uses the categorizer to expand distribution lists and to identify alternative recipients and forwarding addresses. After the categorizer retrieves full information about the recipients, it uses that information to apply policies, route the messages, and perform content conversion.

If the email is sent to internal user, those emails are then delivered locally by the store driver to a recipient’s mailbox, if the emails is intended for external recipient they’re delivered remotely by using SMTP to send messages to another transport server.
If you are looking for better understanding about Message Routing in Exchange Server 2010, kindly refer here

We will have a look on the types of queues in Transport Server on my next post…

Exchange 2010 Server Roles

Like Exchange Server 2007, we have the same 5 server roles architecture in Exchange Server 2010. Below give the short description of Server roles in Exchange Server 2010.

Mailbox Server: This server hosts mailboxes and public folder databases. Any client connection to access mailboxes comes through CAS server only and Public Folder MAPI access with directly connect to Mailbox Server.

Client Access Server: This is the server that hosts the client protocols responsible to provide access to (POP3), (IMAP4), (HTTPS), Outlook Anywhere, Availability service, and Autodiscover service.

Hub Transport Server: This is the mail routing server that routes mail within the Exchange organization. This server role can also be used as routing server to route emails to external organization.

Unified Messaging Server: This is the server that connects a Private Branch exchange (PBX) system to Exchange 2010. Provides a universal inbox for emails, voice mail and fax messages

Edge Transport Server: This is the mail routing server that typically sits at the perimeter of the topology and routes mail in to and out of the Exchange organization. By default Anti-spam agents are installed and it supports Transport Rule and Address Rewriting.

It’s a short note on server roles in Exchange Server 2010. We will discuss about those server roles functionality in later topics.

Post Installation Steps on Exchange Server 2010

Once Exchange Server 2010 installation is completed the complete functionality of Exchange Server is deployed. We need to perform some post installation tasks to make Exchange Server 2010 fully functional. Below are the details post installation options we are going to see in this post.

Step 1: Verify the Exchange 2010 installation
Step 2: Post installation task on Client Access Server
Step 3: Post installation task on Hub Transport Server
Step 4: Post installation task on Mailbox Server
Steps 5: Post installation task on Unified Messaging Server
Step 6: Post installation task on Edge Transport Server
Verify the Exchange Server 2010 installation
Setup Verification
If any problem with the exchange server infrastructure, the installation won’t complete successful, but when Exchange 2010 installation get completed smoothly it’s good to review the below logs to see whether any error occurred during the installation
Check the application event log for any warning or error message and
Check the Exchange Setup logs which get created during the exchange 2010 installation. It will be available on the exchangeinstallationdirectoryExchange Setup logsExchange Setup.log

Entering Product Key
Click on the Server configuration and selecting a server will give an option to enter a product key on the action pane.
Post Installation task on Client Access Server
Securing Client Access Server
To have secure client access functionality between the client and the Client Access Server, By default all the client protocols like OWA, EAS and Auto discover are ssl enabled. All these certificates are self-signed SSL certificated, we have to deployed a SSL option from a trusted Certification Authority for all the enabled Client Access Server features
By default POP3/IMAP are enabled on mailbox but this feature is disabled in Server. We have to manually set the option by starting the POP3/IMAP4 services.

Exchange Active Sync Policy
By default Exchange Active Sync feature is enabled for all the mailboxes, but we have to define a Exchange Active Sync policy with the security, authentication and policy settings for mobile devices

Configure Client Access Server External Domain
During the first Exchange Server 2010 client access server is installation the below option to configure client access server external domain will prompt to enter the external domain name where we can enter the details if it is a internet facing client access server.



If that first server was not a internet facing client access server, then we can skip this step. If we want to configure this option later then point to Server configuration -> Client Access Server -> Right click and select the configure Client Access server external domain, then you have to enter the external OWA url.

Post installation steps for Hub Transport Server
Accepted Domain
By default, the domain name which is used to installed exchange server 2010 will be considered as a SMTP address space for the entire mailbox. If we want the exchange server 2010 to receive email for other SMTP domain names, then we have to
  • Add the Accepted Domains in Exchange Server 2010
  • Those domain names to be registered in Global DNS
  • MX record for that domain needs to be forwarded/point to your Static IP address
Internet Mail Flow
By default, Hub Transport server is not configured for Internet mail flow. We have to configure the Internet mail flow using one of the below 3 options
Deploy an Edge Transport server and manually configure the Send connectors and Receive connectors that are required for Internet mail flow. Edge Subscription to be done between the Hub Transport Servers and the Edge Transport Server
Manually configure Internet mail flow between your Exchange 2010 organization and Microsoft Exchange Hosted Services or other external SMTP gateway servers, We have to create a Send and receive connectors to point to the Exchange Hosted server or other gateway server to send and receive emails
Configure the Hub Transport server for direct mail flow with the Internet. If exchange 2010 is designed to use the Hub Transport server to send emails directly to internet, we have to create a send and receive connector which is assigned to connect to internet

External Post Master Email Address
We have to manually create a external post master email address to received emails and this email address is used to send system generated emails. By default there won’t any post master email address created when HUB Transport server is installed. We have to manually create it using Set-TransportConfig -ExternalPostmasterAddress postmaster@domainname.com
Post Installation Steps for Mailbox Server
Offline Address Book Generation Server
We have to decide which server will be designated as an offline address book generation server. B y default the first installed mailbox server will be assigned as the OAB generation servers. If we have multiple OAB created then we have to assign it to particular mailbox database and respective user’s mailbox has to be created in that mailbox database.

Offline Address Book Distribution
Based on the outlook client available on the network, we have to set the Offline Address book distribution method. Organization Configuration -> Mailbox –>Offline Address Book –> Properties will help you the decide the distribution method
High Availability
By default there is no High Availability options for mailbox database, if it is in your design, then you can configure Database Availability Group
Post Installation Steps for Unified Messaging Server
Below are the steps that need to be configured once the UM server role is installed
  • Create a UM Dial Plan
  • Create a UM IP Gateway
  • Add a UM Server to a Dial Plan
  • Enable a User for Unified Messaging
If additional UM server is installed then if we want to place the server in New Dial Plan, then we have to follow the all 4 steps, if not then we can Add the second UM server into an existing UM dial Plan

Post Installation Steps for Edge Transport Server
Edge Subscription
Edge Subscription has to be established between Hub Transport server and the Edge Transport Server

Address Rewriting
If needed, we can set the address rewrite option on Edge transport Server. This Address Rewriting option cannot be set at Hub Transport Server
Above are the Post installation steps for all the Server roles available in Exchange Server 2010 to make the exchange server 2010 fully functional. Other Post installation option like configuring a Client Access Server, deploying a secure role base access control etc, since those are additional options, it is not discussed over here.
And the discussed post installation steps for Exchange Server 2010 are in short note. We will elaborate the options on how to configure will be posted later in this blog.

Installing Exchange Server 2010 Service Pack 1

In this post, we will look on how to install Exchange Server 2010 Server Pack installation on a new Exchange Server environment. Upgrading from Exchange Server 2010 to Exchange Server 2010 SP1 will be discussed on different post
  1. Server Role installation order
If Exchange Server 2010 SP1 is not a typical installation then it has to be installed in the below order
  • Client Access Server
  • Hub Transport Server
  • Mailbox Server
  • Unified Message Server
  • Edge can be installed after deploying CAS, HUB and MB
  1. Prepare the Active Directory
Active Directory Preparation involves the below details
  • Domain Controller, Global Catalog Server and Schema Master Server needs to be running with Windows Server 2003 SP1 or later
  • Domain and Forest functional level has to be Windows Server 2003 or later
  1. Exchange 2010 Server requirements
Operating System has to be Windows Server 2008 SP2 or Windows Server 2008 R2, It can be a Standard or Enterprise edition but it has to be x64 edition
Prerequisites like .Net Framework 3.5 SP1, Windows PowerShell 2.0 and other windows features are to be manually installed if we are installing Exchange Server 2010 SP1 on Windows Server 2008 SP2. If you are installing Exchange Server 2010 Sp1 on Windows Server 2008 R2 SP1, then use the below switch from command prompt to install the basic prerequisite
C:E2K10SP1 Installation FilesScriptsServerManagerCMD –IP –Exchange-Base-XML
For complete prerequisites click here to know the detail
  1. Active Directory Preparation
From Exchange 2010 SP1 Server, use the below exchange installation switches to prepare the Schema, Active Directory and Domain
  • Schema Preparation
C:E2K10SP1 Installation FilesSetup.com /PrepareSchema
  • Prepare Active Directory
C:E2K10SP1 Installation FilesSetup.com /PrepareAD /OrganizationName:YourExchangeOrgName
  • Prepare Domain
C:E2K10SP1 Installation FilesSetup.com /PrepareDomain
Installing Exchange Server 2010 SP1
Run the below exchange installation switch from command prompt
C:E2K10SP1 Installation FilesSetup.com /Mode:Install /Roles: CA,HT,MB,UM,MT