Wednesday 28 December 2011

Configuring Public folder replication Using powershell

If you want to configure Public folder replication the easy way then use powershell and the AddReplicaToPFRecursive.ps1 script supplied by Microsoft.

Make sure you run the command from the Program Files\Microsoft\Exchange Server\V14 directory or where ever you installed exchange.  Note this also works for Public folder replication between Exchange 2007 and Exchange 2010 if you are doing a migration, just make sure you run the script from Exchange 2010.


To replicate the System Public Folders

.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree" -ServerToAdd "ServerName"

To replicate the Default Public Folders

.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\" -ServerToAdd "ServerName"

Monday 12 December 2011

Steps to Configure a DAG array in Exchange 2010

Here is the steps in Powershell  to create a DAG, configure the DAG networks and assign the DAG to a CAS array.  Make sure all mailbox servers are on the same subnet.  Also in my example I have 2 network cards per mailbox server one for MAPI traffic and another for Replication.  Everything in BLUE is what needs to be changed for your environement


Create DAG (Using a Hub Transport for a Witness server is pretty standard practice)
1.1.    From Powershell  New-DatabaseAvailabilityGroup –Name "DAG" –WitnessServer server” –WitnessDirectory c:\DagWitness\Dag –DatabaseAvailabilityGroupIPAdresses x.x.x.x
2.       Add Mailbox Servers to DAG
2.1.    From Powershell Add-DatabaseAvailabilityGroupServer –Identity Dag –MailboxServer Servername
3.       Configure DAG Network Settings
3.1.    From PowerShell Set-DatabaseAvailabilityGroupNetwork –Identity Dag\DAGNetwork01 –Name “MAPI” –Subnets X.X.X.X/24 –ReplicationEnabled $false
3.2.    From Powershell Set-DatabaseAvailabilityGroupNetwork –Identity Dag\DAGNetwork02 –Name “Replication” –Subnets X.X.X.X/24 –ReplicationEnabled $True
4.       Configure MailBox serves with CAS Array
4.1.   From Powershell  Get-MailboxDatabase –server “Servername” | Set-MailboxDatabase –RpcClientAccessServer "CAS ARRAY NAME"

By doing the above steps you will have a DAG configured and all mailboxes you created will automatically be assigned to the CAS Aray.

Friday 9 December 2011

Disabled Mailbox not showing in Disconnected mailbox section

Some times when you disable a mailbox it does not show right away in the disconnected mailbox area.  That usually means Exchange has not run maintenance yet.  If you need to it done pronto and wan't to see the disabled mailbox then run the below powershell command, as it will preform maintenance on the DB.


Clean-MailboxDatabase "MailboxDatabaseName"

Thursday 8 December 2011

Disable MailTips in Exchagne 2010

If you want to disable MailTips in Exchange 2010 run the below command.

Set-OrganizationConfig -MailTipsAllTipsEnabled $false

Wednesday 7 December 2011

How to Enable end users to manage Distribution List memberships in Exchange 2010

Well I migrated from exchange 2007 to 2010 and was hit with a little problem.  Users who where able to manage their Distribution Groups lists were no longer able to mange them.  They could no longer add or remove members and got an insufficient premissions message.  I confirmed they were set to owner but that did not seem to matter.  After a bit of research I realized that I needed to enable a management role in exchange 2010.  The management role was MyDistributionGroups.  I also realized that this group had way to much power as the end users would be able to create and delete Distribution groups if I enabled it.  So what I did was copy it and modify it.  Below are the steps needed to enable Users to manage Distribution groups that they are set to owner.

1. In the EMS create a new Management Role
New-ManagementRole -Name MyDistributionGroupsCopy -Parent MyDistributionGroups –Description     “This role enables end users to view distribution groups and add or remove members to distribution groups they own.”

2. Now since this role copied the management role MyDistributionGroups we need to modify it and remove some rights.
Remove-ManagementRoleEntry MyDistributionGroupsCopy\Set-Group -Confirm:$false
Remove-ManagementRoleEntry MyDistributionGroupsCopy\Remove-DistributionGroup -Confirm:$false
Remove-ManagementRoleEntry MyDistributionGroupsCopy\New-DistributionGroup -Confirm:$false



3. Now we need to set the Distribution Group Parameters
set-ManagementRoleEntry MyDistributionGroupsCopy\Set-DistributionGroup -parameter Confirm ,ErrorAction ,ErrorVariable ,Identity ,MailTip ,MailTipTranslations , OutBuffer ,OutVariable ,WarningAction ,WarningVariable ,WhatIf

4. Now the final step is to assigned this role to the default role policy so it gets pushed to all users
New-ManagementRoleAssignment -Role MyDistributionGroupsCopy -Policy “Default Role Assignment Policy”


Just double check this policy is enabled, you can do that by using ECP

Thursday 1 December 2011

Exchange 2010 Console Initialization failed

Initialization failed

Getting the above error when you installed the management console for exchange 2010 on your workstation or member server. The reason could be that you just recently applied a service pack or Rollup update to your exchange system. If you did make sure you run the same update on your workstation or server witch has the console and then it will connect. The reason it does not connect is that the console is a different version from the exchange server.

Powershell command to move a storage group to a database from exchange 2007 to exchange 2010

Need to move all mailboxes in a  storage group on exchange 2007 to a database on exchange 2010.  Below are a few ways to do it through powershell

get-mailbox -databse "Source Datbase" | New-MoveRequest -TargetDatabase 'target database' -BadItemLimit '25'

The above command creates a move request for all mailboxes in the source database to the target database.

You can also do the same thing by writing the powershell command differently below.

get-mailbox -resultsize unlimited|? {$_.Database -eq "source datbase "} | New-MoveRequest -TargetDatabase 'target datbase' -BadItemLimit '25'

the above command is pretty much saying get mailboxes where the database is set to source and then move it to database that has a name of target.
The one thing about powershell is their are multiple ways to do the same thing.