Office365: Set maximum attachment/email size

Hopefully this helps someone else out there; the amount of PowerShell commands and cmdlets can be quite overwhelming, and knowing what add-on you need for PowerShell to manage your Office365 installations can be a big time waster. Here’s my notes.

1. Windows 7 comes with Powershell v2 as part of the package, and Win8 comes with v3. If you’re using Vista or XP you’ll have to update to at least v2 but that’s outside of this post.

2. Install Microsoft Online Services Sign-On Assistant for IT Pros:

http://www.microsoft.com/en-us/download/details.aspx?id=39267&fwLinkID=286152

(32-bit for 32-bit OS, 64-bit for 64-bit OS)

3. Install Windows Azure AD Module (may be unnecessary for this procedure, but will be necessary for others – I install it by default)

http://technet.microsoft.com/en-us/library/jj151815.aspx

4. Reboot after install.

5. Start Powershell as admin (you will notice a new program group-Windows Azure Active Directory with a Powershell shortcut; it’s safe to start this or the main Powershell program for our purpose).

6. Once in PS, and having your admin credentials for your Office365 subscription, enter the following commands;

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $LiveCred -Authentication Basic –AllowRedirection

Import-PSSession $Session

Get-TransportConfig

‘ now – pay special note to the output from this last command, “Get-TransportConfig” – look for the lines “InternalDsnMaxMessageAttachSize” and “ExternalDsnMaxMessageAttachSize”. This is your current max for outbound and inbound emails. Most likely it’s at 10MB, and not what you want.

Set-TransportConfig -InternalDsnMaxMessageAttachSize (nn)MB

‘ change the (nn) to a number – in meagabytes – that you want for your maximum. Might be 20, 40, etc… supposedly the global max is 25.

Set-TransportConfig -ExternalDsnMaxMessageAttachSize (nn)MB

‘ again, see above note on what to replace (nn) with…

Get-TransportConfig

‘ now check your config – you should see your new max sizes replaced with what you programmed.

Office365: Set maximum attachment/email size.

How to Purchase Licenses in Office 365

1.    In the Admin center, click purchase services on the left hand side. On this page, you will be able to purchase your Dynamics CRM Online and Office 365 licenses.

2.    Customize your order by choosing the number of licenses you’d like to order. You have optional add-ons to select from before checking out. Once you have the number of licenses you want, click check out.

3.    Follow the three steps Microsoft lays out for you to purchase your licenses. If you would like to add more licenses or purchase more licenses or add other Office 365 plans to your subscription, you can do so in the purchase services section in the admin center.

·         To drop a license or subscription from your account, you will need to open a service request ticket with Microsoft. You’ll want to open the ticket under the billing department.

Purchasing Licenses in Office 365 | The CRM Book.

How to Export and Import mailboxes to PST files in Exchange 2007 SP1

Export/Import to PST Requirements

In order to export or import mailboxes to PST files the following requirements must be met:

  1. Export/Import to PST must be run from a 32 bit client machine with Exchange Management Tools installed (Version Exchange 2007 SP1 or later). The 32bit requirement comes from a dependency with the Outlook client.

http://www.microsoft.com/en-us/download/confirmation.aspx?id=11876

  1. Either Outlook 2003 or Outlook 2007 must be installed on the client machine.
  2. The user running the task must be an Exchange Organization Admin or an Exchange Server Admin on the server where the mailbox to export/import lives.

Exporting mailboxes to PST files

The most basic cmdlet to export a mailbox to a PST file is as follows:

Export-Mailbox –Identity <mailboxUser> -PSTFolderPath <pathToSavePST>

PSTFolderPath must be a full path pointing either to a directory or to a (.pst) file. If a directory is specified a PST file named after the mailbox alias will be used as the target of the export. Note that if the PST file already exists the contents of the mailbox will be merged into it.

After the cmdlet finishes execution, the .pst file will be ready in the specified location.

To export multiple mailboxes to their respective .pst files at once you can pipe in the identities of those mailboxes to the export task. Notice that when bulk exporting the PSTFolderPath parameter must forcefully point to a directory since one .pst file will be created for each mailbox.

Example:

Get-Mailbox -Database ‘exchange_server_name\MDB’ | Export-Mailbox -PSTFolderPath D:\PSTs

Filtering content in Export/Import to PST

When only specific content is desired in the PST file (or back into the mailbox) a common set of filters can be used to leave out the rest of the messages. Export/Import to PST support the following filters: Locale, StartDate, EndDate, ContentKeywords, SubjectKeywords, AttachmentFileNames, AllContentKeywords, SenderKeywords, and RecipientKeywords.

Example: Import only those messages that were created between 1/1/06 and 12/1/06 and contain the word “review” in the subject and any of the words {“project”,”alpha”} in the body.

Import-mailbox -Identity ricardr -PSTFolderPath D:\PSTs -StartDate 1/1/06 -EndDate 12/1/06 -SubjectKeywords:’review’ -ContentKeywords:’project’,’alpha’

Issues:

When you run the command you get an error:

Error occurred in the step: Moving messages.

Failed to copy messages to the destination

mailbox store with error:

MAPI or an unspecified service provider.

ID no: 00000000-0000-00000000

It is probably because you don’t have permission to the mailboxes (it happens even if you are an administrator).

To solve this you need to get access permissions:

  1. Right click the Exchange Management Shell, and select Run as Administrator (this is a handy trick).
  2. Type the command “Get-Mailbox | Add-MailboxPermission -accessrights fullaccess -user Administrator” – if prompted, apply to ALL objects.
  3. Run the export or import.
  4. Type the command “Get-Mailbox | Remove-MailboxPermission -accessrights fullaccess -user Administrator” – Select “NO” when prompted about the Administrator mailbox! You can select “YES” for all other mailboxes, or apply to all if you want.

Sources:

http://blogs.technet.com/b/exchange/archive/2007/04/13/3401913.aspx

http://www.interworks.com/blogs/bfair/2009/08/19/empty-all-exchange-2007-mailboxes