TechShizz | All posts tagged 'Exchange 2010'

Export Mailbox to PST

Before you can export/import you need to assign the permission to do this to a custom management role. See Technet: https://technet.microsoft.com/en-gb/library/ee633452(v=exchg.141).aspx

 

Also:

https://technet.microsoft.com/en-us/library/ff459227(v=exchg.141).aspx

 

This was also useful:

http://serverfault.com/questions/386104/error-in-new-mailboxexportrequest-couldnt-find-the-enterprise-organizational

 

Applies to Exchange 2010 SP2 +

 

There are two ways to do this:

  1. You can either create a Universal Security group and then make that the group which allows access to a user to be able to Import/export in exchange

 

Create the group in AD (Named "Enterprise Support" in this example)

 

New-ManagementRoleAssignment -Name "Import Export_Enterprise Support" -SecurityGroup "Enterprise Support" -Role "Mailbox Import Export"

 

 

  1. Apply the users to the Management Role Assignment group and there will be not security group.

 

 

Add the admin to the Management Role Assignment

 

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User John

 

 

====================================================

EMS MUST BE RUN AS ADMINISTRATOR

 

To export a mailbox into a PST file:

 

New-MailboxExportRequest -Mailbox AylaKol -FilePath \\MBX-01\PSTFileShare\Ayla_Recovered.pst

 

From <https://technet.microsoft.com/en-us/library/ff459227(v=exchg.141).aspx>

 

====================================================

EMS MUST BE RUN AS ADMINISTRATOR

To export a specific date range:

 

New-MailboxExportRequest -Mailbox Rich -ContentFilter {(Received -lt '01/01/2010') -and (Received -gt '01/01/2009')} -FilePath \\MBX-01\PSTFileShare\Ayla_Recovered.pst

 

From <https://technet.microsoft.com/en-us/library/ff601762(v=exchg.141).aspx>

 

 

Content Filters

 

https://technet.microsoft.com/en-us/library/ff601762(v=exchg.141).aspx

 

Has attachment -

-ContentFilter {HasAttachment -eq $true}

 

Received - (date must be MM/DD/YYYY)

-ContentFilter {(Received -lt '01/01/2010') -and (Received -gt '01/01/2009')}

 

Subject -

-ContentFilter {Subject -like '*meeting*'}


What if it Failed?

Add the switch -BadItemLimit Unlimited -AcceptLargeDataLoss. 

You can get a detailed report on why the exports fail with this command. 

Get-MailboxExportRequest -status failed | Get-MailboxExportRequestStatistics -IncludeReport | Format-List > c:\report.txt

PowerShell Remote Administration - Implicit Remoting

To administer Office 365 you will need the following:

 

Azure AD PowerShell

 

Prerequisites

 

  • Windows 7+ / Server 2008R2 +
  • .NET 3.51 Framework
  • All cloud services subscription updates
  • Online Services Sign-in Assistant - OS Specific - From MS Download Centre.
  • Azure Administrative Console - From MS Download Centre.

See this link : http://technet.microsoft.com/library/jj151815.aspx

Download from HERE

Connect to Office 365 to administer Users, Licenses etc. (Not Exchange)

 

$msolcred = get-credential
connect-msolservice -credential $msolcred

 

(Log in with your  user@domain.onmicrosoft.com account)

 

To Administer Exchange in Office 365

 

 

Launch Azure Module for PowerShell or import the module - Import-Module MSOnline

 

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

 

Import-PSSession $Session

 

To administer another exchange server via PowerShell remotely

 

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://mail.mydomain.com/powershell -Credential $UserCredential -Authentication Basic -AllowRedirection

 

Import-PSSession $Session

 

You may need to change the -Authentication switch to "Kerberos" depending on security settings.

 

To administer share point online

 

You need to download and install the SharePoint PowerShell module before this will work:

https://www.microsoft.com/en-gb/download/details.aspx?id=35588

 

$UserCredential = Get-Credential

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

$SP = Read-Host -Prompt 'Enter SharePoint Domain'

Connect-SPOService -Url https://$SP-admin.sharepoint.com -credential $UserCredential

 

To administer Skype for Business Online (Lync)

 

You need to download and install the Skype for Business PowerShell module before this will work:

https://www.microsoft.com/en-gb/download/details.aspx?id=39366

 

$UserCredential = Get-Credential

Import-Module SkypeOnlineConnector

$sfboSession = New-CsOnlineSession -Credential $UserCredential

Import-PSSession $sfboSession

 

One big script

 

if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoExit -NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; Exit }

Import-Module MSOnline

$UserCredential = Get-Credential

Connect-MsolService -Credential $UserCredential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

$SP = Read-Host -Prompt 'Enter SharePoint Domain'

Connect-SPOService -Url https://$SP-admin.sharepoint.com -credential $UserCredential

Import-Module SkypeOnlineConnector

$sfboSession = New-CsOnlineSession -Credential $UserCredential

Import-PSSession $sfboSession

White-list a domain in Exchange

$WhiteDomain = (Get-ContentFilterConfig).BypassedSenderDomains

$WhiteDomain.add(“example.com”)

Set-ContentFilterConfig -BypassedSenderDomains $WhiteDomain

DAG Failures

If a Mailbox copy becomes unhealthy or fails it will be necessary to suspend the mounted database and failover to the database copy.

 

The failed copy can be un-mounted, renamed and moved to another location for safe keeping.

 

You can then create a new database copy from the failover copy back to the original location from the DAG tab in EMC.