Tuesday, May 24, 2016

Exchange Online LitigationHold with Power Shell

Place a mailbox on Litigation hold to reserve all mailbox content, including deleted items and original versions of modified items. If you have enabled user’s archive mailbox is also placed on hold. Deleted and modified items are preserved for a given period.

 How Litigation Hold Works

  • When a mailbox is placed on Litigation Hold, items in the purges sub-folder are preserved for the hold duration specified by Litigation hold.
  • Hold duration is calculated from the original date an item was received or created & defines how long items in the purges sub-folder are held.
  • When the litigation hold duration expires for an item in the purges sub-folder, the items marked permanent deletion and will be purged from Exchange.

Power Shell to Manage the LitigationHold

Connect Office 365 with using following cmdlet


$UserCredential = Get-Credential

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

Import-PSSession $Session

Assign the Litigation Hold to specific Office 365 mailbox

Set-Mailbox –Identity “Mailbox Name” –LitigationholdEnabled $True

Set-Mailbox –Identity “Dsingh” –LitigationHoldEnabled $True


Define the time range

Set-Mailbox –identity “Mailbox” –LitigationHoldEnabled $True –LitigationHoldDuration

Set-Mailbox –identity “Dsingh” –LitigationHoldEnabled $True –LitigationHoldDuration 3600

Assign Litigationhold all Online mailbox (Bulk Mode)

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -LitigationHoldEnabled $True


Assign Litigation Hold based on CSV file

Import-CSV  C:\Temp\Litigation.csv | Set-Mailbox -LitigationHoldEnabled $True -LitigationHoldDuration 3600


Enable Litigation Hold Based on department

Get-Recipient -RecipientTypeDetails UserMailbox -ResultSize unlimited -Filter '(Department -eq "Finance")' | Set-Mailbox -LitigationHoldEnabled $True


Assign LitigationHold to Exchange Online recipients that don’t have Litigation Hold


Get-Mailbox | Where {$_.LitigationHoldEnabled -match "False"} | ForEach-Object {$Identity = $_.alias; Set-Mailbox -Identity $Identity -LitigationHoldEnabled $True }


Display information about all of the mailboxes which have Litigation Hold

Get-Mailbox -ResultSize Unlimited | FL LitigationHold*


Display information about specific recipient which his mailbox has Litigation Hold

Get-Mailbox -identity "Dsingh" | FL LitigationHold*


Remove Litigation Hold to specific recipient (Exchange Online mailbox)
Set-Mailbox -LitigationHoldEnabled $False

Set-Mailbox -identity "Dsingh" -LitigationHoldEnabled $False


Remove Litigation Hold to all of the Exchange Online recipients (Bulk mode)

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -LitigationHoldEnabled $False

Wednesday, May 11, 2016

Migrating from Exchange 2010 to Exchange 2016 Part-7

Part 6 we covered basic configuration as well as pilot mailbox migration.

In this part i will work on bulk mailbox migration and public folder migration from Exchange 200 to Exchange 2016.

Bulk Mailbox Migration


Once we have tested the pilot users functionality, everything is working as expected, now we have to migrate bulk mailboxes from Exchange 2010 to Exchange 2016.
We can use PowerShell command to migrate mailbox, which is the best way:

Import-CSV "C:\Move.CSV" | Foreach (New-MoveRequest _identity $_.Identity -TargetDatabase MDB01)
we can also get the move status

Public Folder Migration


As you know most of our customer still using public folder in on premise Exchange 2010 and want to migrate on newer version

Once all mailbox migrated into Exchange Server 2016, now one of the most critical part is migrate the Exchange 2010 public folder to Exchange 2016.

Migrating Public Folder to Exchange 2016 slimier  to Migrating to Exchange 2013. 

You can check the my post to Migrate Public Folder in details which described step by steps 


There are some issue Data loss may occur during public folder migration to Exchange 2013, Exchange 2016, Before starting batch migration, make sure that all public folders have a replica on the public folder database that will be specified as the source for migration. Also, make sure that the public replication is in sync. You can check here for more workaround for Public folder migration.

Decommissioning the Exchange Server 2010


Now we are reached to remove the Exchange server 2010 from our Exchange environment. As we are good to go in Exchange Server 2016 environment, already we change the mail flow routing, assigned new offline address book, moved all legacy mailboxes on Exchange 2016 also we migrated public folder on new modern public folder.

Before removing the Exchange 2010 servers its important to verify the some of the application or devices are using the Exchange 2010 server as a relay server, we need to double check all devices & application has been moved on Exchange 2016 servers.

Also verify the inbound and outbound mail flow, it should be flow via Exchange 2016 servers.

For decommissioning the Exchange 2010 servers you need to follow up the ITSM process, there are some steps you have to follow up:

1. Double check all mailboxes has been migrated on Exchange 2016.
2. Verify all Public folder has been migrated to modern public folder in Exchange 2016.
3. Verify mail flow happening via Exchange 2016.
4. All related application & devices are configured Exchange 2016 servers as a relay server.
5. Once verify all above points stop the Exchange services from Exchange servers and set the disable state.
6. Monitor the Exchange environment for one week.
7. If everything working fine than shutdown the server for 2 week and monitor the environment.
8. If everything fine after shut downing the Exchange 2010 server process for decommissioning the Exchange 2010 servers.



In this articles i have covered mailbox bulk migration, public folder migration to modern public folder and decommissioning the Exchange Servers 2010.

Now we reached end of the series, hope i have covered everything which we need to follow up during migration.

I will be glad for any feedback for future improvement.

Thanks!


Tuesday, May 10, 2016

Office 365: The operation couldnt be performed because object user1@Domain.com couldnt be found on copr.man.pro.outlook.com

When i tried to move user's mailbox from on premise to Office 365 and getting error " The operation couldnt be performed because object user1@Domain.com couldnt be found on copr.man.prod.outlook.com".

I checked on user's account on Office 365 admin portal, user's account was reflating and seems fine.



This error indicate user's Active Directory account did not sync on Azue Active Directory properly.

For resolving this issue i have to remove user from online (Azure Active Directory) completely than next DirSync will take care to syncing the user's account into Azure Active Directory.

For removing user's account from Azure Active Directory i have run following command :

1. First connect the Office 365
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

2. Run below command

Remove-Msoluser -UserPrincipalName user1@domain.com

3. Than run command :
Remove-Msoluser -userPrincipalName user1@domain.com -RemovefromRecycleBin

Once run all command, now wait for next DirSync replication or you can force the DirSync.

Once DirSync completed try to move the mailbox from on premise to Office 365.