Exchange Server 2010Comments (0)

Comments

You need sign in to comment! Sign up today!

Understanding Automatic Mailbox Distribution in Exchange 2010Comments (0)

In Exchange 2010 we have thing called Automatic Mailbox Distribution which is a process of distributing the mailboxes between the databases.
This this occurs by default and is used for instance when using New-Mailbox, Enable-Mailbox or New-MoveRequest

This occurs if we are using:
- New-Mailbox without any Database parameter set
- Enable-Mailbox without any Database parameter set
- New-MoveRequest without TargetDatabase parameter set

We can also exclude a database from the potential targets of this automatic distribution.

Set a mailbox database as permanently excluded from automatic mailbox distribution:
Set-MailboxDatabase 'DatabaseName' -IsExcludedFromProvisioning $True

Set a mailbox database as temporarily excluded from automatic mailbox distribution:
Set-MailboxDatabase 'DatabaseName' -IsSuspendedFromProvisioning $True

How the process works:
1. Exchange retrieves a list of all mailbox databases in the Exchange 2010 organization.
2. Any mailbox database that are marked as excluded are removed from the list.
3. When using RBAC scope that are applied to the administrator it removes the databases outside the scope.
4. Any mailbox database that are hosted outside of the local Active Directory site where the operation is being performed is removed from the list.
5. From the remaining list of mailbox databases, Exchange chooses a database randomly under the presumption that they are online and healthy.

Comments

You need sign in to comment! Sign up today!

How to add a Public Folder replica using Powershell in Exchange 2010Comments (0)

When moving to a new Exchange 2010 environment and still are using Public Folder, this is the fast way of adding a new replica.

Add a replica of all public folders to the new environment:
.\AddReplicaToPFRecursive.ps1 -TopPublicFolder \ -Server 'SourceServer' -ServerToAdd 'TargetServer'

Note:
In Exchange RTM we needed to change the AddReplicaToPFRecursive.ps1, in SP1 this is fixed.
Add a single quote ‘ around the $TopPublicFolder in the two lines listed. That allows the script to recognise the entire string and not to break it at the first space.

if ($server)
{
$getpfcmd = “get-publicfolder -server $Server -identity ‘$TopPublicFolder’ -Recurse -resultsize unlimited”
}
else
{
$getpfcmd = “get-publicfolder -identity ‘$TopPublicFolder’ -Recurse -resultsize unlimited”
}


Add a replica of all relevant system folders to the new environment:
.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree\EFORMS REGISTRY" -Server 'SourceServer' -ServerToAdd 'TargetServer'

.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree\OFFLINE ADDRESS BOOK" -Server 'SourceServer' -ServerToAdd 'TargetServer'

.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree\SCHEDULE+ FREE BUSY" -Server 'SourceServer' -ServerToAdd 'TargetServer'

Comments

You need sign in to comment! Sign up today!

Backing up Exchange 2010 using Windows BackupComments (0)

For small organizations or in a test environment where you dont want to install thirdparty software this could help you alot.

First of all we need to install the backup feature.

Install the Feature
1. Go to the Server Manager
2. Choose Add Feature
3. Choose Windows Server Backup Features
4. Check both Windows Server Backup and Command-Line Tools check-box
5. Choose Next and then Install

Enable the feature
1. Press Start then Run
2. Enter Services.msc and type Run
3. Locate “Microsoft Exchange Server Extension for Windows Server Backup”, set it to start automatic and start it.

Do a backup
1. We can now do a single backup or choose to do a scheduled one.
2. Choose the volumes where the Bin- database and log files are stored
3. Go to Advanced Settings and choose VSS backup
4. Done

Comments

You need sign in to comment! Sign up today!

AuthorizationManager check failed during Exchange Server 2010 RU/SP1 installationsComments (0)

Troubleshooting is not a funny topic but when you finally find the root cause it feels pretty nice.

The thing is when you install SP1 or an rollup the setup will restart some services. Among these services there are the Windows Management Instrument (WMI) service that was Disabled and stopped. When this service is stopped the setup can’t use the ServiceControl.ps1 script to execute some setup features.

The following error will be displayed:

The following error was generated when “$error.Clear(); if (Test-Path $RoleBinPath\ServiceControl.ps1) { & $RoleBinPath\ServiceControl.ps1 EnableServices $RoleRoles.Replace(‘Role’,”).Split(‘,’); & $RoleBinPath\ServiceControl.ps1 Start Critical }” was run: “AuthorizationManager check failed.”.

To resolve this issue:

Step 1: Allow local execution policy to be executed

Get-ExecutionPolicy -list

Scope                                             ExecutionPolicy
-----                                             ---------------
MachinePolicy                                     RemoteSigned
UserPolicy                                        Undefined
Process                                           Undefined
CurrentUser                                       Undefined
LocalMachine                                      RemoteSigned


Set LocalMachine to Unrestricted:
Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted

Step 2: Enable WMI service
During the setup I focused on the services and when the WMI service was Disabled, I re-enabled it (Automatic) and then started the service.
This time the ServiceControl.ps1 script could be executed since both the execution policy were set to Unrestriced and the WMI service was started.

Comments

You need sign in to comment! Sign up today!

How to run Exchange 2010 scripts from Task SchedulerComments (0)

Exchange scripts can be scheduled to be run from any workstation or server, with or without the Exchange Management Tolls installed.

A script can look like this to execute a statistic script with Exchange Management Shell installed:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; c:\Scripts\StatisticsScript.ps1"

Without Exchange Management Shell:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://EX02company.com/PowerShell/ -Authentication Kerberos ; Import-PSSession $s ; Get-MailboxStatistics -Database DB01"

Scheduling a Task

1. Open up Task Scheduler
2. Create a Basic Task
3. Name the event
4. Choose date/time
5. On Action, choose Start a Program
6. In the Program/script enter the code:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://EX02company.com/PowerShell/ -Authentication Kerberos ; Import-PSSession $s ; Get-MailboxStatistics -Database DB01"

7. Press Next
8. Verify the code
9. Press Finish

Comments

You need sign in to comment! Sign up today!

Useful scripts to use when patching Exchange DAG members!Comments (0)

Some news scripts has been added to Exchange Server 2010 SP1 to help an administrator put a DAG member in maintenance mode, ready to be patched or whatever!

The scripts are located under the Scripts folder of the default installation path as usual:

When a server enters the maintenance mode it will:
- Move all active databases to another DAG member
- Pause the node in the cluster
- Sets the DatabaseCopyAutoActivationPolicy mailbox server setting to Blocked

To put a server in maintenance mode:
StartDagServerMaintenance.ps1 -serverName EXMBX-NODE1

To remove the server from maintenance mode:
StopDagServerMaintenance.ps1 -serverName EXMBX-NODE1

Finaly we can re-balance the databases between the nodes:
RedistributeActiveDatabases.ps1 -DagName DAG01 -BalanceDbsByActivationPreference -ShowFinalDatabaseDistribution -Confirm:$false

Comments

You need sign in to comment! Sign up today!

How to perform a single item recovery in Exchange 2010 using the shellComments (0)

Single item recovery is a very important feature of Exchange Server 2010. It provides a good layer of protection to recover items in a fast way without recovering an entire mailbox or mailbox database from various backup media like the tape.

The method is divided into two steps
1. Perform a search based on various criteria
2. Restore the items to the users mailbox or to a .PST file.

First off, we need to grant the ability to search mailboxes. By default there are no accounts that have these permissions – provide them carefully to a few selected staff/helpdesk members.
In this example we are granting Alex Westwood the Discovery Management permission:

Add-RoleGroupMember "Discovery Management" -Member awestwood

Perform the search
In this example we are searching Jack Smith’s mailbox for emails from Dana Cox with keyword Energy – and saves the information into a folder called Jack Smith Recovery in the Discover Search Mailbox mailbox:

Search-Mailbox "Jack Smith" -SearchQuery "from:'Dana Cox' AND Energy" -TargetMailbox "Discovery Search Mailbox" -TargetFolder "Jack Smith Recovery" -LogLevel Full

Restore the information
From here we could restore the mail to Jack Smith’s mailbox in a folder called Recovered Messages and delete the information from the Discovery Search Mailbox mailbox:

Search-Mailbox "Discovery Search Mailbox" -SearchQuery "from:'Dana Cox' AND Energy" -TargetMailbox "Jack Smith" -TargetFolder "Recovered Messages" -LogLevel Full -DeleteContent

…or export the data to a .PST file:

New-MailboxExportRequest -Mailbox "Discovery Search Mailbox" -SourceRootFolder "Jack Smith Recovery" -ContentFilter {Subject -eq "Energy meeting"} -FilePath \\SERVER01\SHARE\JackSmithRecovery.pst

Comments

You need sign in to comment! Sign up today!

Useful script to determine backup status in Exchange Server 2010!Comments (0)

This script made by Paul Cunningham over at exchangeserverpro.com can help you determine whether a DB has been backed up or not!

$server = $env:computername

$now = [DateTime]::Now
"Server: " + $server
"Current time: " + $now

$db = get-MailboxDatabase -server $server -status
foreach ($objItem in $db)
{
$lastfull = $objItem.lastfullbackup
if (!$lastfull)
{
$fullago = "n/a"
}
else
{
$fullago = $now - $lastfull
$fullago = $fullago.TotalHours
$fullago = "{0:N0}" -f $fullago
}

$lastinc = $objItem.lastincrementalbackup
if (!$lastinc)
{
$incago = "n/a"
}
else
{
$incago = $now - $lastinc
$incago = $incago.TotalHours
$incago = "{0:N0}" -f $incago
}

$returnedObj = new-object PSObject
$returnedObj | add-member NoteProperty -name "Database" -value $objItem.Name
$returnedObj | add-member NoteProperty -name "Last Full (hrs ago)" -value $fullago
$returnedObj | Add-Member NoteProperty -name "Last Inc (hrs ago)" -value $incago
$returnedObj
}


It looks like this:
[PS] C:\Scripts>.\check-dbbackups.ps1
Server: SE-EX001
Current time: 04/28/2011 13:17:14

Database        Last Full (hrs ago)          Last Inc (hrs ago)
--------        -------------------          ------------------
DB01            31                           9
DB02            28                           9
DB03            n/a                          n/a

Comments

You need sign in to comment! Sign up today!

Unattended Exchange 2010 installation on Windows Server 2008 R2Comments (0)

This guide will help you do an unattended installation of the typical Exchange roles.

Network Pre-Requirements
1. Disable Chimney
netsh int tcp set global chimney=disabled

2. Disable IPv6
Edit the registry using regedit:
Browse to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters

Add a new D-Word (32-bit value) of ffffffff

Operatingsystem Components
1. Use the ServerManagerCmd cmdlet in the Exchange media folder to install the required Windows fetures and roles:
ServerManagerCmd –ip Exchange-Typical.xml

Typical = Client Access, Hub Transport and Mailbox Windows requirements

Exchange 2010 Requirements
1. Prepare the Environment
setup.com /PrepareLegacyExchangePermissions

2. Prepare Schema
setup.com /PrepareSchema

3. Prepare AD
setup.com /PrepareAD

4. Prepare Domains
setup.com /PrepareDomain

Other requirements
1. Start and set NetTcpPortSharing Service to Automatic
Set-Service NetTcpPortSharing -StartupType Automatic

2. Download and install Office 2007 filterpack (x64)
http://www.microsoft.com/downloads/details.aspx?FamilyId=60C92A37-719C-4077-B5C6-CAC34F4227CC&displaylang=en

Install Exchange
1. This will install the Exchange roles Client Access, Hub Transport and Mailbox to the folder D:\Program Files\Microsoft\Exchange Server
setup.com /m:install /role:C, H, M /TargetDir:"D:\Program Files\Microsoft\Exchange Server"

Comments

You need sign in to comment! Sign up today!

Moving SMTP Queue path to another volumeComments (0)

If you would like to move the SMTP queue to another volume it can be done using the following method:

Edit the EdgeTransport.exe.config file:
notepad 'c:\Program Files\Microsoft\Exchange Server\V14\bin\EdgeTransport.exe.config'

Change the following keys under the appSettings section:
QueueDatabasePath value
QueueDatabaseLoggingPath value

to the desired value: like D:\Queue\QueueDB and D:\Queue\QueueLogs

Next step is to restart the Transport service using:
net stop MSExchangeTransport && net start MSExchangeTransport

Comments

You need sign in to comment! Sign up today!

How to copy receive connector settings and add them to another connectorComments (0)

This will help you move settings from a specific connector and apply them on another connector on another server etc.

To copy AuthMechanism and MaxMessageSize:
Get-ReceiveConnector EX2007\Relaying | %{Set-ReceiveConnector EX2010\Relaying -AuthMechanism $_.AuthMechanism -MaxMessageSize $_.MaxMessageSize}

To copy RemoteIPRanges:
Get-ReceiveConnector EX2007\Relaying | %{Set-ReceiveConnector EX2010\Relaying -RemoteIPRanges $_.RemoteIPRanges}

To copy Bindings:
Get-ReceiveConnector EX2007\Relaying | %{Set-ReceiveConnector EX2010\Relaying -Bindings $_.Bindings}

To copy PermissionGroups:
Get-ReceiveConnector EX2007\Relaying | %{Set-ReceiveConnector EX2010\Relaying -PermissionGroups $_.PermissionGroups}

Comments

You need sign in to comment! Sign up today!

Configure WNLB for the CAS ArrayComments (0)

This will help you get NLB up and running.

First we need to configure the NICs on each memberserver and configure binding order so that public is at top and the metric value set to 1. (private should be set to 2)

Load the import module:
Import-Module ServerManager

Add NLB:
Add-WindowsFeature NLB

Start the wizard and specify the first node in the cluster. choose the VIP address and Mask that is going to be used. Then specify the ports TCP 25, 80, 110, 135, 143, 443, 1024-65535 (or use all) and then finalize the wizard.
When its green and ready add a second node. When they have converged that part is ready.

Next step is to allow Nic forwarding:
# netsh interface ipv4 set int ”Private” forwarding=enabled

Comments

You need sign in to comment! Sign up today!

Change the logging pathsComments (0)

This will help you reconfigure the location of various logging.

POP3 Location
Set-POPSettings -Server EX2010 -ProtocolLogEnabled $true -LogFileLocation "D:\Logs\POP3"

IMAP4 Location
Set-IMAPSettings -Server EX2010 -ProtocolLogEnabled $true -LogFileLocation "D:\Logs\IMAP4"

SMTP Send Location
Set-TransportServer EX2010 -SendProtocolLogPath "D:\Logs\SMTP\Send"

SMTP Receive Location
Set-TransportServer EX2010 -ReceiveProtocolLogPath "D:\Logs\SMTP\Receive"

Queue Database Location
Notepad %ExchangeInstallPath%Bin\EdgeTransport.exe.config

Comments

You need sign in to comment! Sign up today!