Wednesday, October 23, 2013

How to Create a Public Folder Calendar in Exchange 2010

Use EMC to create Public Folder

1.       In the console tree, click Toolbox.
2.       In the result pane, double-click Public Folder Management Console.
3.       In the public folder tree of the Public Folder Management Console, navigate to Default Public Folders, and then select the parent public folder for the public folder you want to create.
4.       In the action pane, click New Public Folder.
5.        On the Introduction page, complete the following fields:
o    Name   Use this box to type the name of the new public folder.
o    Path   Use this read-only box to verify the path to the public folder. If this box displays a backslash (\), the public folder that you are creating will be a top-level public folder. 
noteNote:
To change the path, close the wizard, and then, in the Public Folder Management Console, select the public folder under which you want to create this public folder, and start the wizard again.
6.        On the Completion page, review the following, and then click Finish to close the wizard: 
o    A status of Completed indicates that the wizard completed the task successfully. 
o    A status of Failed indicates that the task wasn't completed. If the task fails, review the summary for an explanation, and then click Back to make any configuration changes.
7.       Click Finish to close the wizard.


To apply user permissions:
1. Right click the folder and choose Properties and click Permissions tab and add the user.

Drive Mapping - Logon Script

Logon3.vbs
' VBScript logon script program.
'


Option Explicit

Dim objNetwork, objSysInfo, strUserDN
Dim objGroupList, objUser, objFSO
Dim strComputerDN, objComputer

Set objNetwork = CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.userName
strComputerDN = objSysInfo.computerName

' Escape any forward slash characters, "/", with the backslash
' escape character. All other characters that should be escaped are.
strUserDN = Replace(strUserDN, "/", "\/")
strComputerDN = Replace(strComputerDN, "/", "\/")

' Bind to the user and computer objects with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
Set objComputer = GetObject("LDAP://" & strComputerDN)

' Map a network drive if the user is a member of the group.
' Alert the user if the drive cannot be mapped.
If (IsMember(objUser, "Engineering") = True) Then
    If (MapDrive("M:", "\\FileServer\EngrShare") = False) Then
        MsgBox "Unable to Map M: to AdminShare"
    End If
End If

' Add a network printer if the computer is a member of the group.
' Make this printer the default.
If (IsMember(objComputer, "Front Office") = True) Then
    objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2"
    objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2"
End If

Function IsMember(ByVal objADObject, ByVal strGroup)
    ' Function to test for group membership.
    ' objGroupList is a dictionary object with global scope.

    If (IsEmpty(objGroupList) = True) Then
        Set objGroupList = CreateObject("Scripting.Dictionary")
    End If
    If (objGroupList.Exists(objADObject.sAMAccountName & "\") = False) Then
        Call LoadGroups(objADObject, objADObject)
        objGroupList.Add objADObject.sAMAccountName & "\", True
    End If
    IsMember = objGroupList.Exists(objADObject.sAMAccountName & "\" _
        & strGroup)
End Function

Sub LoadGroups(ByVal objPriObject, ByVal objADSubObject)
    ' Recursive subroutine to populate dictionary object objGroupList.

    Dim colstrGroups, objGroup, j

    objGroupList.CompareMode = vbTextCompare
    colstrGroups = objADSubObject.memberOf
    If (IsEmpty(colstrGroups) = True) Then
        Exit Sub
    End If
    If (TypeName(colstrGroups) = "String") Then
        ' Escape any forward slash characters, "/", with the backslash
        ' escape character. All other characters that should be escaped are.
        colstrGroups = Replace(colstrGroups, "/", "\/")
        Set objGroup = GetObject("LDAP://" & colstrGroups)
        If (objGroupList.Exists(objPriObject.sAMAccountName & "\" _
                & objGroup.sAMAccountName) = False) Then
            objGroupList.Add objPriObject.sAMAccountName & "\" _
                & objGroup.sAMAccountName, True
            Call LoadGroups(objPriObject, objGroup)
        End If
        Exit Sub
    End If
    For j = 0 To UBound(colstrGroups)
        ' Escape any forward slash characters, "/", with the backslash
        ' escape character. All other characters that should be escaped are.
        colstrGroups(j) = Replace(colstrGroups(j), "/", "\/")
        Set objGroup = GetObject("LDAP://" & colstrGroups(j))
        If (objGroupList.Exists(objPriObject.sAMAccountName & "\" _
                & objGroup.sAMAccountName) = False) Then
            objGroupList.Add objPriObject.sAMAccountName & "\" _
                & objGroup.sAMAccountName, True
            Call LoadGroups(objPriObject, objGroup)
        End If
    Next
End Sub

Function MapDrive(ByVal strDrive, ByVal strShare)
    ' Function to map network share to a drive letter.
    ' If the drive letter specified is already in use, the function
    ' attempts to remove the network connection.
    ' objFSO is the File System Object, with global scope.
    ' objNetwork is the Network object, with global scope.
    ' Returns True if drive mapped, False otherwise.

    Dim objDrive

    On Error Resume Next
    If (objFSO.DriveExists(strDrive) = True) Then
        Set objDrive = objFSO.GetDrive(strDrive)
        If (Err.Number <> 0) Then
            On Error GoTo 0
            MapDrive = False
            Exit Function
        End If
        If (objDrive.DriveType = 3) Then
            objNetwork.RemoveNetworkDrive strDrive, True, True
        Else
            MapDrive = False
            Exit Function
        End If
    End If
    objNetwork.MapNetworkDrive strDrive, strShare
    If (Err.Number = 0) Then
        MapDrive = True
    Else
        Err.Clear
        MapDrive = False
    End If
    On Error GoTo 0
End Function

Tuesday, October 15, 2013

Exchange Server 2010 Database Availability Group Installation Step by Step

Microsoft Exchange Server 2010 introduced a new high availability feature called the Database Availability Group (DAG).

Exchange Server 2010 Database Availability Group Overview

A Database Availability Group is a group of up to 16 Exchange Server 2010 servers that are installed with the Mailbox server role.  Each server that is a member of the DAG is capable of hosting active or passive copies of mailbox databases that reside on servers in the group.
For example, a Database Availability Group may consist of three Exchange Server 2010 Mailbox servers, each configured with a single Mailbox database.  Each server that is a member of the DAG can host either an active or passive copy of each of the three total mailbox databases.
Exchange Server 2010 Database Availability Group Example
Exchange Server 2010 Database Availability Group Example
The foundation of an Exchange Server 2010 Database Availability Group is Windows Failover Clustering.  However unlike traditional Exchange server clusters which existed in an active/passive state, and in which the entire cluster group needed to failover to an alternative node together, with Exchange 2010 DAGs each mailbox database can failover (or switchover, if it is a deliberate move) to another DAG member independent of the other mailbox databases in the DAG.
This means that any given Mailbox server in the DAG can host all, some or none of the active mailbox copies at any given time.  This capability provides two immediate advantages over previous clustering models:
  • All of the Mailbox servers within the Exchange 2010 DAG can be active and in use at all times to some capacity
  • Each mailbox database can failover/switchover when necessary without impacting the mailbox users connected to other mailbox databases within the DAG, for example when installing updates on DAG members

Understanding Quorum for Exchange Server 2010 Database Availability Groups

Because the Database Availability Group utilizes an underlying Windows Failover Cluster the concept of quorum applies.  If you are not familiar with quorum consider it as basically a voting process in which a majority of voting members must be present to make a decision.
For a cluster this means that an odd number of members must be involved in the voting process for a majority decision to be made.  How this applies to an Exchange Server 2010 DAG is that if you deploy a DAG with just two Mailbox servers as members (or any even number up to 16), then neither server is able to determine by majority vote whether it should make its own copy of a given mailbox database active.
To achieve quorum for a DAG with an even number of member servers another server in the same site is designated as a File Share Witness for the cluster.  This is typically a Hub Transport server though it can technically be any compatible Windows server.

Database Replication in Exchange Server 2010 Database Availability Groups

There are two ways that mailbox database replication occurs between Exchange Server 2010 DAG members.
In Exchange Server 2010 RTM “file mode” replication is used.  With file mode replication as each transaction log is written and then closed off (once it reaches 1Mb in size) it is then copied to each member of the DAG that also holds a copy of that mailbox database.  The other members receive the file into their replay queue, and then replay the transaction log file into their own passive copy of the database.
File mode replication works fine but has an obvious shortcoming in that any transaction logs that have not yet been shipped to other servers in the DAG can be lost if the Exchange server hosting the active database copy fails.  In those cases one of the other DAG members is able to bring their copy of the mailbox database online and then request missing emails be resent from the transport dumpster of Hub Transport servers within the site.
In Exchange Server 2010 SP1 file mode replication is used to bring mailbox database copies into sync with each other (eg during the initial sync process when a new database copy is added).  Once they are in sync the DAG members switch to “block mode” replication.  In block mode replication each database transaction is written to the log buffer on the active server and also sent to the log buffer of DAG members hosting passive copies of the database.
When the log buffer becomes full each DAG member then builds their own transaction log files from their own log buffer.  Block mode replication has an advantage over file mode replication in failure scenarios, because each DAG member is completely up to date with all changes to the active database.
Note that Public Folder databases can reside on Mailbox servers that are members of a Database Availability Group, however they are not replicated by the DAG itself.  Instead you must use Public Folder replication to provide redundant copies of Public Folder databases.

Other Advantages of Exchange Server 2010 Database Availability Groups

Before we proceed with an example of how to install an Exchange Server 2010 DAG I will also mention some of the other advantages of Database Availability Groups.
  • Unlike previous versions of Exchange Server (particularly Exchange Server 2007) Exchange Server 2010 has just one high availability feature for Mailbox servers for all high availability deployment scenarios
  • When you create a Database Availability Group the underlying Windows Failover Cluster is automatically created and configured for you
  • A Database Availability Group can be created at any time without requiring Exchange Server 2010 to be removed and reinstalled from the server, unlike previous versions that required that clusters be established first before Exchange was installed
  • Exchange Server 2010 DAG members can host other server roles, unlike Exchange Server 2007 that prevented clustered Mailbox servers from hosting other roles

Exchange Server 2010 Installation Step by Step

In this tutorial I will demonstrate the installation of an Exchange Server 2010 Database Availability Group on Windows Server 2008 R2.
For this tutorial the following Exchange servers have already been installed.
  • EX1 – Exchange Server 2010 SP1 Mailbox server
    • Primary interface: 192.168.0.32/24
    • Secondary interface: 10.0.5.1/30
  • EX2 – Exchange Server 2010 SP1 Mailbox server
    • Primary interface: 192.168.0.33/24
    • Secondary interface: 10.0.5.2/30
  • EX3 – Exchange Server 2010 SP1 Client Access and Hub Transport server
    • Primary interface: 192.168.0.34/24
Exchange Server 2010 DAG Tutorial Setup
Exchange Server 2010 DAG Tutorial Setup
Each of the Mailbox servers has been configured with its own mailbox database.
  • EX1 – Mailbox Database 01
  • EX2 – Mailbox Database 02
Note: in Exchange Server 2010 each mailbox database must have a unique name within the organization.
Because the Mailbox servers are configured with dual interfaces it is important to make sure that the secondary interface is not configured to register itself in DNS.  Open the TCP/IPv4 properties for the secondary interface one each server, click the Advanced button, navigate to the DNS tab and untick Register this connection’s address in DNS.
Open the Advanced TCP/IPv4 Properties
Open the Advanced TCP/IPv4 Properties
Disable DNS registration for the secondary interface
Disable DNS registration for the secondary interface

Creating the Database Availability Group

Log in to one of the Mailbox servers and launch the Exchange Management Console.  Navigate to Organization Config/Mailbox and choose New Database Availability Group from the action pane.
Create a new Exchange Server 2010 Database Availability Group
Create a new Exchange Server 2010 Database Availability Group
When the New Database Availability Group wizard starts give the DAG a name, specify the Witness server, and also specify the file path for the Witness server to use.
New Database Availability Group Wizard - Basic Info
New Database Availability Group Wizard - Basic Info
Click on the New button to create the new Database Availability Group, and then click Finish to close the wizard.

Adding Database Availability Group Members

Right-click the newly created Database Availability Group and choose Manage Database Availability Group Membership.
Manage Database Availability Group Members
Manage Database Availability Group Members
Click the Add button and select the Mailbox servers that you wish to make members of the DAG.
Select Mailbox Servers to become Database Availability Group Members
Select Mailbox Servers to become Database Availability Group Members
Click the Manage button to commence adding the Mailbox servers to the DAG.  This involves installation and configuration of Windows Failover Clustering on the servers, so it can take a few minutes to finish.
After it has finished the next step is to configure the DAG networking.

Configure Database Availability Group Networking

Right-click the newly created Database Availability Group and choose Properties.
Open the Properties of the Database Availability Group
Open the Properties of the Database Availability Group
Select the IP Addresses tab, click the Add button and add a static IP address for the Database Availability Group.
Adding IP addresses to an Exchange Server 2010 Database Availability Group
Adding IP addresses to an Exchange Server 2010 Database Availability Group
You will notice that the Database Availability Group has been automatically configured with DAG networks for the subnets that the DAG members have network interfaces connected to.
Exchange Server 2010 Database Availability Group Networks
Exchange Server 2010 Database Availability Group Networks
Open the Properties of each DAG network and configure them with meaningful names.  If you have configured your network to have a dedicated replication network for the DAG then you should disable replication on the DAG network that is intended for MAPI communications (ie client connections).
Exchange Server 2010 Database Availability Group Networks Configured
Exchange Server 2010 Database Availability Group Networks Configured

Adding Mailbox Database Copies to DAG Members

With the Database Availability Group established and the networking configured you can now add mailbox database copies to other DAG members.
In the Exchange Management Console navigate to Organization Config/Mailbox and choose the Database Management tab.  Right-click a mailbox database and select Add Mailbox Database Copy.
Adding a Mailbox Database Copy in Exchange Server 2010
Adding a Mailbox Database Copy in Exchange Server 2010
Click the Browse button and choose the Mailbox server to add the database copy to.
Add Mailbox Database Copies to an Exchange Server 2010 Mailbox Server
Add Mailbox Database Copies to an Exchange Server 2010 Mailbox Server
Click the Add button to add the mailbox database copy and then click Finish to close the wizard.
The Exchange servers will now commence seeding the replica servers with an up to date copy of the database and all of the current transaction log files.  Depending on the amount of data to be replicated this may take some time.
Status of the Database Copies for Exchange Server 2010
Status of the Database Copies for Exchange Server 2010
Repeat the same process for any other mailbox databases you wish to add database copies for.

Installing Exchange Server 2010: The Typical Server

A Typical Exchange Server 2010 is one that runs the Client Access, Hub Transport, and Mailbox server roles.  This is the type of installation that would be performed in a single server organization.
There are two methods for performing the installation – command-line, or GUI.
Before beginning the installation make sure you have

Installing a Typical Server in Command-Line Mode

Launch an elevated Command Prompt and run Exchange Server setup with the following parameters.  Note that the /LegacyRoutingServer parameter is only required if you have an existing Exchange 2003 server in the organization.  Replace “exch2003.contoso.local” below with the name of your existing Exchange Server 2003 server.
setup /m:install /r:h,c,m,t /LegacyRoutingServer:ex2003.contoso.local
What did we just do?  We ran the setup command with the following parameters:
  • /m:install – places setup in Install Mode
  • /r:h,c,m,t – installs the Hub Transport, Client Access, Mailbox, and Management Tools roles
  • /LegacyRoutingServer – tells setup to create a legacy Routing Group Connector to the specific Exchange 2003 server
Exchange Server 2010 setup will run in unattended mode.
Welcome to Microsoft Exchange Server 2010 Unattended Setup

By continuing the installation process, you agree to the license terms of
Microsoft Exchange Server 2010. If you don't accept these license terms,
please cancel the installation. To review these license terms, please go to

http://go.microsoft.com/fwlink/?LinkId=150127&clcid=0x409/

Press any key to cancel setup................
No key presses were detected.  Setup will continue.
Preparing Exchange Setup

    Copying Setup Files              ......................... COMPLETED

The following server roles will be installed
    Languages
    Management Tools
    Hub Transport Role
    Client Access Role
    Mailbox Role

Performing Microsoft Exchange Server Prerequisite Check

    Language Pack Checks             ......................... COMPLETED
    Hub Transport Role Checks        ......................... COMPLETED
    Client Access Role Checks        ......................... COMPLETED
    Mailbox Role Checks              ......................... COMPLETED
 If Microsoft Outlook 2003 is in use, you should replicate the free/busy folder
on this server to every other free/busy server in the organization. This step sh
ould be performed once Setup completes.

Configuring Microsoft Exchange Server

    Preparing Setup                  ......................... COMPLETED
    Stopping Services                ......................... COMPLETED
    Copying Exchange Files           ......................... COMPLETED
    Language Files                   ......................... COMPLETED
    Restoring Services               ......................... COMPLETED
    Languages                        ......................... COMPLETED
    Exchange Management Tools        ......................... COMPLETED
    Hub Transport Server Role        ......................... COMPLETED
    Client Access Server Role        ......................... COMPLETED
    Mailbox Server Role              ......................... COMPLETED
    Finalizing Setup                 ......................... COMPLETED

The Microsoft Exchange Server setup operation completed successfully.
Setup has made changes to operating system settings that require a reboot to tak
e effect. Please reboot this server prior to placing it into production.
Restart the server when unattended setup is complete.

Installing a Typical Server in Graphical Mode

From the location that you extracted the Exchange Server 2010 setup files launch the Setup.exe file.
Select Step 3: Choose Exchange language option, and choose to Install only languages from the DVD.
Select Step 4: Install Microsoft Exchange.
Step through the Exchange Server 2010 Setup wizard introduction, license agreement, and error reporting dialogs.
  
Choose “Typical Exchange Server Installation”.  You can also choose a different path for the program files if you want to install to a different volume.
I’m going to walk through configuring internet facing services in a later article, but you can enter a public name here at this stage if you want to.
If you are installing into an existing Exchange Organization with Exchange 2003 servers, at the Mail Flow Settings dialog click Browse and choose the existing Exchange Server 2003 server to be configured as a routing group partner.
 
The Customer Experience Improvement Program is optional.
When the Readiness Checks are successful you can proceed with the install.  Note: the Outlook 2003 free/busy warning is normal and does not prevent you from proceeding with the install.
Restart the server when setup has completed, and then run Windows Update to ensure that the latest updates are installed before proceeding further.

Exchange 2010 Deployment: Preparing Active Directory

Applying the Exchange Server 2007 SP2 Schema Update

When installing to an existing Exchange 2003 organization, and to retain backward compatibility with Exchange Server 2007, the Active Directory schema updates for Exchange Server 2007 are applied first.
You must perform these steps with an account that is a member of the Enterprise Admins and Schema Admins groups.
Exchange Server 2007 setup will not run on Windows Server 2008 R2, even just to perform the schema update.  If you have installed Windows Server 2008 R2 to run Exchange Server 2010 you will need to run the Exchange Server 2007 schema update from a different server that runs either:
Note that the server you run the schema update from cannot be an existing Exchange server.
If you have installed Windows Server 2008 to run Exchange Server 2010 you can run the schema update on that server.
The server must reside in the same Active Directory Site as the Schema Master, and you will need to use the 32-bit or 64-bit Exchange Server 2007 setup files to match the operating system of the server you will run the schema update from.
Download the Exchange Server 2007 files from Microsoft and extract them the server.  Launch a Command Prompt and run the Exchange Server 2007 schema update.
setup /PrepareAD

Applying the Exchange Server 2010 Schema Update

You must perform these steps with an account that is a member of the Enterprise Admins and Schema Admins groups.  The server that you run the update from must reside in the same Active Directory Site as the Schema Master.
Download the Exchange Server 2010 files from Microsoft and extract them the server. Launch a Command Prompt and run the Exchange Server 2010 schema update.
setup /PrepareAD
If you have an Active Directory with multiple Domain Controllers you should wait for the new schema to replicate throughout the network before proceeding.

Installing Exchange Server 2010 Pre-Requisites on Windows Server 2008 R2

Exchange Server 2010 can be installed on either Windows Server 2008 64-bit with Service Pack 2, or Windows Server 2008 64-bit R2, and either Standard or Enterprise editions.
In this post I’ll walk through installing the pre-requisites for Exchange Server 2010 on Windows Server 2008 R2.
Servers that will host the Hub Transport or Mailbox server roles require the Microsoft Filter Pack which can be downloaded here: http://go.microsoft.com/fwlink/?linkid=137042
After installing the Filter Pack run the following command from an elevated Windows PowerShell console.
Import-Module ServerManager
To install a “Typical” Exchange server running the Client Access, Hub Transport, and Mailbox server roles, run the following command from an elevated Windows PowerShell console.
Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy -Restart
Note that other combinations of server roles require different groups of pre-requisites. You can see a complete list of these options here.
You can also check out Pat Richard’s script for automating the installation of pre-requisites for different servers roles.
The server will require a restart, which will occur automatically by using the –Restart switch on the command above.
After the restart launch another elevated Windows PowerShell console and run the following command.
Set-Service NetTcpPortSharing -StartupType Automatic
After installing the pre-requisites run Microsoft Update to verify the latest updates and patches are applied to the server before proceeding with the Exchange Server 2010 install.

Exchange 2010 Planning: Verifying Your Existing Network Environment

Before you can deploy Exchange Server 2010 into an existing Exchange organization you must verify that your existing network environment meets the pre-requisites.

Active Directory Pre-Requisites

Active Directory requires the following to support Exchange Server 2010.
ComponentRequirement
Schema MasterThe Schema Master must be running one of the following operating systems:
  • Windows Server 2003 Standard/Enterprise with SP1 (x86 or x64)
  • Windows Server 2003 R2 Standard/Enterprise with SP1 (x86 or x64)
  • Windows Server 2008 Standard/Enterprise (x86 or x64)
  • Windows Server 2008 R2 Standard/Enterprise
Global CatalogIn each Site that will contain an Exchange server there must be at least one Global Catalog running one of the above operating systems.
Domain ControllerIn each Site that will contain an Exchange server there must be at least one writable Domain Controller running one of the above operating systems.
Functional LevelWindows Server 2003 Functional mode or higher.

Exchange Organization Pre-Requisites

The existing Exchange Organization must be at least Exchange 2003 Native Mode, and all Exchange servers must be at least Exchange Server 2003 with Service Pack 2.

Exchange Pre-Deployment Analyzer

The Microsoft Exchange Pre-Deployment Analyzer is used to scan existing environments to verify their readiness for Exchange Server 2010.
Download the Exchange Pre-Deployment Analyzer tool from Microsoft and install it on your Exchange Server 2003 server.
Step through the wizard to perform a scan of your Exchange Organization, and address any outstanding issues that it reports.

Exchange Server 2007 Compatibility

When you are transitioning from Exchange Server 2003 to Exchange Server 2010 it is recommended to first run the Exchange Server 2007 Active Directory schema update.  This ensures that if the need arises later on that an Exchange Server 2007 server can be installed into the environment.
If only the Exchange Server 2010 schema update is applied you can never add an Exchange Server 2007 server to the environment.

Link State Suppression

The Exchange Pre-Deployment Analyzer report may warn you that Link State Suppression is not enabled on the Exchange Server 2003 servers.  Link State Suppression is only required if you plan to add more than one connector between the Exchange Server 2010 server and existing Exchange Server 2003 servers.