Search This Blog

Wednesday, 29 September 2010

Quickly Create 100 Test Users and Mailbox

This Awesome Command will quickly create 100 Test Users and Mailbox`s in your test lab.
 
Just copy and paste the command below exactly straight into the Exchange Powershell
 
1..100 | ForEach { Net User "User$_" MyPassword=01 /ADD /Domain; Enable-Mailbox "User$_" }

Quick Powershell Script to Verify the health and status of the DAG

 Save the following commands as a PowerShell script (.PS1) file:
(Get-DatabaseAvailabilityGroup -Identity (Get-MailboxServer -Identity $env:computername).DatabaseAvailabilityGroup).Servers | Test-MapiConnectivity | Sort Database | Format-Table -AutoSize
Get-MailboxDatabase | Sort Name | Get-MailboxDatabaseCopyStatus | Format-Table -AutoSize
function CopyCount
{
$DatabaseList = Get-MailboxDatabase | Sort Name
$DatabaseList | % {
$Results = $_ | Get-MailboxDatabaseCopyStatus
$Good = $Results | where { ($_.Status -eq "Mounted") -or ($_.Status -eq "Healthy") }
$_ | add-member NoteProperty "CopiesTotal" $Results.Count
$_ | add-member NoteProperty "CopiesFailed" ($Results.Count-$Good.Count)
}
$DatabaseList | sort copiesfailed -Descending | ft name,copiesTotal,copiesFailed -AutoSize
}
CopyCount


Run the PS1 Script to see a overview on the complete status of the DAG

Thursday, 23 September 2010

Want to Prioritise Windows NLB Traffic on Exchange 2010 or 2007 CAS Servers ?

Scenario
========

Multiple Exchange 2010 CAS Servers, Possible Mixture of Virtual and Physical configurations, or Lower and Higher Spec Servers.

Requirement
===========

You would like to ensure that most of the traffic is handled by the Higher spec or physical servers to utilise as much resource as possible.

Solution
========

Use Windows NLB LOAD WEIGHT Parameter
To prioritise traffic to the server with the Higher Load weight,



When using Multiple hosts filtering mode, this parameter specifies the relative amount of load-balanced network traffic that this host should handle for the associated port rule. Allowed values range from 0 (zero) to 100. To prevent a host from handling any network traffic, set the load weight to 0 (zero).

The actual fraction of traffic handled by each host is computed as the local load weight divided by the sum of all load weights across the cluster.

You can specify different load weights for each host in the cluster by using the Load weight parameter. You can specify that all hosts distribute the network load equally by using the Equal load distribution parameter instead of the Load weight parameter.

OK, But How do I know its doing whats its suppose to do ?
===============================================

Easy, and Very Accurate, Using good old Perfmon you can add the following counters to see how many
RPC Access Clients are connected (Outlook) and how many OWA Users are connected,
and you should see the load is spread as you want.
Counters:
"MSExchange RPCClient Access\Active User Count"
"MS Exchange OWA\Current Users"

Wednesday, 1 September 2010

Unable to Activate Exchange 2010 Mailbox Database "Error: content index catalog files in the following state: 'Failed'.

Issue:
you attempt to move the active copy from a mailbox DAG Member server to another server you get error:

--------------------------------------------------------
Microsoft Exchange Error
--------------------------------------------------------
Cannot activate database copy 'Activate Database Copy...'.

Activate Database Copy...
Failed
Error:
An Active Manager operation failed. Error: The database action failed. Error: An error occurred while trying to validate the specified database copy for possible activation. Error: Database copy 'DB1' on server 'dag01' has content index catalog files in the following state: 'Failed'.

To Resolve this issue re-seed the Content Index:
1. Restart the MSExchange Search service on the node which has the active database.
2. Run update-mailboxdatabasecopy -catalogonly on each passive DAG Member
3. Activate Required Database

e.g. Command
update-MailboxDatabaseCopy -Identity "DAG01-DB10\DAGMB02" -CatalogOnly

This will seed from Datatabase DAG-01\DB10 to Passive Server DAGMB02

Tuesday, 24 August 2010

Create Custom Exchange 2007 / 2010 OPATH Custom Address Lists and EAP with Recipient Filters

To Create a new Address list which is filtered on users UPN and Creates in a Container called Test Dept (To Create at the root, Replace with \:

New-AddressList -Name "Test Address List" -Container "Test Dept" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and ((UserPrincipalName -like '*@test.co.uk') ))}


To Create EAP based on users UPN:

New-EmailAddressPolicy -Name "AD Net EAP" -EnabledPrimarySMTPAddressTemplate "smtp:%g.%s@test.com" -RecipientFilter "UserPrincipalName -like '*@ad.net'" -Priority "9"

Monday, 23 August 2010

Enable Adobe iFilter for Exchange 2010

Microsoft has tested and supports all of the default IFilters installed with Exchange Server 2010. Third-party IFilters can be added, which could extend the capability for inspecting additional file types. However, Microsoft has not tested third-party IFilters with Transport Rules, so it is highly advised that you fully test any third-party IFilters before deploying into your production environment. Additional files can be parsed by installing and registering the file type's IFilter on each Hub Transport server. For example, you can add support for inspecting PDF file attachments by downloading and installing the Adobe PDF IFilter. After that, simply register the IFilter DLL to the Exchange server registry location: 

  1. Identify the CLSID of the installed IFilter (search under HKeyClassesRoot\CLSID\ in the registry, or get it from installation docs)
    For example, the CLSID for PDF files is:
    {E8978DA6-047F-4E3D-9C78-CDBE46041603}
  2. Create a new registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\MSSearch\CLSID with the same name as the CLSID, and a default value which points to the full path of the IFilter DLL file.
    For example, for PDF files, the default path of the PDF IFilter is:
    C:\Program Files\Adobe\Adobe PDF IFilter 9 for 64-bit platforms\bin\PDFFilter.dll
  3. Create a new key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\MSSearch\Filters with the name of the file extension that the filter will handle. Enter the default value for this key to be the CLSID of the IFilter
    For example, for PDF files, the key you should create:
    Name:
    .pdf
    Value: {E8978DA6-047F-4E3D-9C78-CDBE46041603}
  4. The Network Service needs to have read access to both of these keys. To check the permissions, and allow Read permissions for Network Service, right click on the CLSID and Filter keys, select "Permissions.." Network Service should be added with Read permissions allowed..
Now the Transport Rules engine will be able to inspect these file attachments for the key words and text patterns configured in the Transport Rule condition. The registry cache automatically refreshes every 30 minutes, but if you want the changes to be immediately applied, then restart the Exchange Transport Service on the Hub Transport Server where you made the change. At the Exchange Shell prompt:
Restart-Service msexchangetransport
Restart-Service MSExchangeSearch

Force Re-Build and crawl of index`s on each mailbox server
.\ResetSearchIndex.ps1 –Force –All

Thursday, 19 August 2010

Error Creating New Database Exchange 2010


Couldn't mount the database that you specified. Specified database: 
<test3>; Error code: An Active Manager 
operation failed. Error: The database action failed. Error: Operation 
  failed   with message: MapiExceptionNotFound: Unable to mount database. 
 (hr=0x8004010f,  ec=-2147221233) [Database: <test3>, Server:   <Servername>]. 
An Active Manager operation failed. Error: The database action failed. Error: 
  Operation failed with message: MapiExceptionNotFound: Unable to mount 
  database.  (hr=0x8004010f, ec=-2147221233) [Database: <test3>
 
Resolution
========
Simply Wait for AD Replication to Occur and attempt to Mount.