Category Archives: Exchange 2007

Just as it says any issue or info with Exchange 2007

Outlook 2010 | Enable/Disable Cached Exchange Mode | Regedit

If “Cached Exchange Mode” in Outlook is grayed it can be switched on/off via regedit.

To Enable OST files and switch cached exchange mode on:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\outlook\cached mode]

To Disable OST files and switch cached exchange mode off:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\outlook\cached mode]

You can also enabled/disable cached exchange mode for shared mail folders (note this is only slightly different and contained under “Policies”):

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Cached Mode]

Reference: KB982697

List “Dynamic Distribution Group” members | EMC PowerShell

If you need to get a list of AD users in “Dynamic Distribution Groups” then you can use this PowerShell script… here. Only problem is that the script does not export details of Dynamic Distribution Group.

You can list DDG users by running this script using the Exchange Management Shell (EMC)

$Group = Get-DynamicDistributionGroup -Identity "Staff-UK"
Get-Recipient -Filter $Group.RecipientFilter -OrganizationalUnit “” | Out-File c:\Staff-UK.txt

Exchange 2007 | Message Size Limits

Want to check the message size limits in Exchange 2007 (GUI)?

Exchange Management Console:


  • Organization Configuration > Hub Transport > Send Connectors Tab, Go to the properties of that send connector. In the General Tab will see a box with a check mark: Maximum Message Size (KB) [update to desired size]
  • Organization Configuration > Hub Transport > Global Settings Tab, Go to the properties of the Transport Settings. In the General Tab will see a box with a check mark: Maximum Send Size (KB) [update to desired size]


  • Organization Configuration > Hub Transport > Global Settings Tab, Go to the properties of the Transport Settings. In the General Tab will see a box with a check mark: Maximum Receive Size (KB) [update to desired size]
  • Server Configuration > Hub Transport > Receive Connectors (Lower box). Update all of your receive connectors: Properties, General Tab: Maximum Receive Size (KB) [update to desired size]

Exchange Powershell:

  • ?

I received the following bounce from the local server due to email size limits.

Delivery has failed to these recipients or distribution lists:

This message exceeds the maximum message size allowed. Microsoft Exchange will not try to redeliver this message for you. Please make the message smaller — by removing attachments, for example — and try sending it again, or provide the following diagnostic text to your system administrator.
Sent by Microsoft Exchange Server 2007
Diagnostic information for administrators:

Generating server:
#550 5.3.4 ROUTING.SizeLimit; message size exceeds fixed maximum size for route ##

Original message headers:

Received: from ([]) by exchange
([]) with mapi; 31 Dec 2011 00:00:00 +0100
Content-Type: application/ms-tnef; name=”winmail.dat”
Content-Transfer-Encoding: binary
From: Sender
To: “Recipient”
Date: 31 Dec 2011 00:00:00 +0100


Forward mail to a Public Folder | EMC PowerShell

This will forward mail to the public folder

Set-Mailbox "NAME.SURNAME" -ForwardingAddress ""
Set-Mailbox "NAME.SURNAME" -ForwardingAddress "" -DeliverToMailboxAndForward $true

Source: Exchangepedia how to forward mail to a public folder.

Exchange 2007 | Sendas email account using alternate domain

I’ve was asked to set up an additional domain name under Exchange 2007. The only issue is that Exchange doesn’t quite handle multiple domain names very well, yes you can add aliases and easily create them within the exchange console, however the problem comes to “sending as” a different domain on the client machine (outlook) I managed to get this method working, although it may not be the best method, I’m couldn’t find any other solutions.

Method 1:

  • Create a new user and mailbox.
  • Set the default email address as
  • Add full send as permissions to the mailbox.
  • Setup redirect so all email to is forwarded to

This is good, but is messy as multiple user accounts are required…

Method 2 (Preferred Method):

  • Setup a new distribution list (remove the alias from users current profile to do this)
  • Add User as the manager of this list and the only member
  • Set the permissions for full send as via the powershell…

You can change mailbox permissions using two methods but only the powershell method seems to work properly (so probably best to stick to this)

  • 1) Via Powershell: Add-AdPermission “DL” -user “name.surname” -AccessRights extendedright -ExtendedRights “send as”
  • 2) From the “users and computers” selected the distribution group changed to “Advanced” settings and edited the security on the DL to add “user” to Full access”

Exchange Delivery Error 5.2.0

User gets an error message when sending email from an external email address to a public folder email using exchange 2007

Delivery has failed to these recipients or distribution lists

#< #5.2.0 smtp;550 5.2.0 STOREDRV.Deliver: The Microsoft Exchange Information Store service reported an error. The following information should help identify the cause of this error: "MapiExceptionNotAuthorized:16.18969:D0130000.....


  1. Logon to the public folder (in Outlook client is easiest)
  2. Right click -> Permissions -> Change -> “Anonymous” User to Create Items (Contributor)
  3. Should do the trick work 🙂

Exchange *.Log File Removal (BAT)

It is BAD BAD practice to try and delete the exchange 2007 log files! It should not be done ever!

Running into space issues on exchange needed to remove 80,000+ *.log files. These would be removed by doing a backup, but without any space to run the backup there’s not a lot of options.

I ran this command to perform a removal of the log files in the mailbox DB, I had to use this script the job as the windows would crash as soon as multiple files were highlighted and selected for deletion:

  • CD /D E:\Exchange\Mailbox\First Storage Group
  • del /s *.txt

In order to move logs onto another drive use this command:

  • CD /D E:\Exchange\Mailbox\First Storage Group
  • move *.log “K:\Exchange_Logs_Move”


  • E00.chk
  • E00.log
  • Mailbox Database.edb

Exchange 2007 | Remote Mobile Wipe

Use the EMC to perform a remote wipe on a mobile phone

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the “Exchange ActiveSync device settings” entry in the Client Access Permissions topic.

1. In the console tree, navigate to Recipient Configuration > Mailbox.
2. Select the user from the Mailbox window.
3. In the action pane, click Manage mobile device, or right-click the user’s mailbox, and then click Manage mobile device.
4. Select the mobile phone you want to clear all data from.
5. In the Actions section, click Clear.
6. Click Clear again.


Continue reading

Exchange 2007 | EMC Powershell

Open “Exchange Management Shell”

Shortcut refs to: (C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1” -noexit -command “. ‘C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1′”)

If this is not installed, look at the following article for installing Exchange:

Don’t get the Exchange Management Shell & Windows Powershell mixed up – for Windows Powershell see:

Adding send as permissions to mailbox:

Add-ADPermission "Mailbox" -User "Domain\User" -Extendedrights "Send As"

Adding full access permissions to mailbox:

Add-MailboxPermission "Mailbox" -User "Trusted User" -AccessRights FullAccess

Adding full access permissions to ALL mailboxes:

Get-Mailboxdatabase | Add-AdPermission -User "Username" -AccessRights GenericAll

List all mailbox stores in size order:

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount

List all mailbox stores in size order (Export to CSV / on Desktop):

Get-MailboxStatistics -Database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Export-CSV test.csv

List all mailbox stores in size order:

Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime

Purge all disconnected mailboxes:

(Add all the disconnected mailboxes into a var by typing the below:)

$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid,Database

Purge all the disconnected mailboxes in the previously made var by typing the below:

$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

List all Public folder email addresses (output to file) 

I had a request for all the email addresses associated to public mailboxes, as these are not displayed on the client in Outlook.


Displays a list of Public Folders & Email addresses output to TXT File (FL = Formats list with full text)

Get-PublicFolder -Recurse | Get-MailPublicFolder | fl DisplayName,Emailaddresses &gt; c:\publicfolders_list.txt

Method2: Displays a list of Public Folders & Email addresses output to CSV File:

# Export-CSV PowerShell Spreadsheet
$FilePath = "c:\publicfolders.csv"
Get-MailPublicFolder | Select-Object DisplayName -expand emailaddresses| Export-CSV $FilePath

List Exchange 2007 Product Version

Get-ExchangeServer | fl name,edition,admindisplayversion

List Exchange 2007 Database Size

Get-MailboxDatabase | foreach-object {add-member -inputobject $_ -membertype noteproperty -name mailboxdbsizeinGB -value ([math]::Round(([int64](get-wmiobject cim_datafile -computername $_.server -filter ('name=''' + $_.edbfilepath.pathname.replace("\","\\") + '''')).filesize / 1GB),2)) -passthru} | Sort-Object mailboxdbsizeinGB -Descending | format-table identity,mailboxdbsizeinGB

List Exchange 2007 GUID

Get-MailboxDatabase -Identity "&lt;server name&gt;\&lt;storage group name&gt;\&lt;database name&gt;" | Format-Table Name, GUID

Public Folder Permissions via Powershell

Type the below, replacing ‘public folder name’ with your public folder name/path and you must keep the \ at the front of it and also replace ‘username’ with the username:

Add-PublicFolderClientPermission -Identity "\public folder name" -AccessRights Owner -User username

Owner can be replaced with the following roles:

  • None
  • Owner
  • PublishingEditor
  • Editor
  • PublishingAuthor
  • Author
  • Non-Editing Author
  • Reviewer
  • Contributor


Finding a Mailbox via Powershell

Get-Mailbox -identity

List Members of a Distribution List (output on screen)

Get-DistributionGroupMember-identity "staff.technical"

List Members of a Distribution List including their primary email address and formatted (output to CSV on C:\)

Get-DistributionGroupMember –identity “staff.technical” | ft name, primarysmtpaddress &gt; c:\members.csv

List Members of a Dynamic Distribution List

$group = Get-DynamicDistributionGroup –identity “AllStaff-DL”
Get-Recipient –RecipientPreviewFilter $group.RecipientFilter | sort name | select name &gt; C:\dlist_members.txt

Continue reading