How to import PST to Office 365 – Exchange Online mailbox

1/ Make sure you have the required permissions

Before importing a pst to an exchange mailbox, make sure your are assigned the role Mailbox Import Export, it’s a pre requisite for using the below process.

2/ Prepare your pst import mapping file

Supposing the pst file you want to import is located in a network share named : \\myPC\ImportPST

Your mapping file should contains the below data

Name : pst file name

Mailbox : the destination mailbox email address

IsArchive : FALSE – because the mailbox we are importing is not an archive mailbox

TargetRootFolder : “/” – we want to import the data to the root folder of the destination folder. If you want to import data to a folder named “myImport” for example, use this synctax : /myImport

In this example, here is how my mapping csv file looks like. I saved it on my computer as import.csv

You are almost ready to import your PST data to an Office 365 mailbox.

3/ Start the import job

Connect to the Security and compliance center (, then under Information governance, select Import > New import job

Name your import job with 2-64 lowercase letters, numbers or hyphens, must start with a letter, no spaces

In the next page, select Upload your data > Next

On the import data page, click on Show network upload SAS URL and copy it to clipboard.

Click on the link Download Azure AzCopy and install it.

The default location of AzCopy will be C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\

You are now ready to begin the data import. Open a PowerShell and run the below command to copy your pst file using AzCopy to a temporary Azure Storage from which you will copy the data to destination mailbox.

cd "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\"

Then run the below commandline replacing the value with your own data

.\AzCopy.exe /Source:"\\myPC\ImportPST" /Dest:"<Copy here the previous SAS URL>" /V:"\\myPC\Logs\AzCopy1.log" /Y

Back to the Import data page, check the two checkboxes “I am done uploading my files” and “I have access to the mapping file” and go on the next page clicking on the next botton.

Now click on “Select mapping file” and choose the the mapping csv we previously built. Validate the file and Save the job to begin file analysis.

A job analyse will start. Once it’s done you will be able to import the PST data to the destination mailbox.

Click on the link “Ready to import to Office 365”, on the next page click on “Import to Office 365” button and start the import job.

Select the Next button, and start the data importation on the next page. Once you are done, you will

4/ Check if the import job was successful

You are done with the copy, now, let’s check in the destination mailbox if the data has been well copied. In outlook, you will see a folder named <source email address>, it’s the email address of the mailbox from which you have exported the pst file.

If you had chosen to import the pst file into a folder named /importPST, you would have seen in Outlook, under that folder another folder named <source email address>

Another way to check your pst import result is use a powershell command :

Get-MailboxFolderStatistics <destination mailbox> | Out-GridView

Et voilà 🙂

How to export Office 365 mailbox to a pst ?

How to export office 365/Exchange online mailbox to PST.

Hello, in this post we are going to see how to export an Office 365 (Exchange online) mailbox content to a PST file. This process can also be used to search for SharePoint, OneDrive, Teams sites, Office 365 group… content. Now that we have set the scene, we can get started.

In the Security and compliance center (, under “Search” click on “Content Search”

In the content search portal, start a New search

Check “Specific location” and select modify to specify the location/mailbox you want to export the content from.

On the next tab, click on “choose users, groups or teams” and specify the mailbox for which you want to export the content to PST.

Select the checkbox and click on Choose, selct Done and on the next tab click on Save to validate your choice.

Save and run to start the content search process.

Give a name to your content search process and click save to start the search.

Once the content search of the mailbox you specified is done, in the menu select Export results.

In the next tab, select the export options according to your need and click on “Export”

The export process has now started, you can see the status in the Exports tab by clicking on the name you gave to your export.

Once the export status is completed, you now can start downloading the result.

Clique on “Copy to clipboard” to copy the “Export secret” and click on “Download the result”. On the next page, enter the Export secret and specify the location where to save the pst file.

Start the downloading process – sorry, my OS is in french version 🙂 . At the end of the downloading, retrieve the pst file in the location you previously specified.

How to import pst to Office 365 ?

Protected: CV

This content is password protected. To view it please enter your password below:

Rename AD User using PowerShell

If you are looking for renaming an AD User attributes like the “name”, you may be interested in this article. Of course, you can customize the command line to change other attribute like the “DisplayName” or another one.

Before doing any change, check the AD User name you want to rename

To check it with PowerShell, use the below command line

Get-ADUser "Tameka Reed" | fl name

Now rename the account with the following command line

Get-ADUser "Tameka Reed" | Rename-ADObject -NewName "Tameka Reed New"

How to check that your change worked ?

Get-ADUser "Tameka Reed" | fl name

In management console Active Directory Users and Computers

Active Directory – CrĂ©er des comptes utilisateurs Ă  partir d’un fichier Csv

Dans cet article nous allons voir comment crĂ©er des comptes d’utilisateurs dans Active Directory Ă  partir d’un fichier Csv.

Prenons l’exemple de ce fichier ci-dessous qui contient la liste des utilisateurs que nous souhaitons crĂ©er. Veuillez noter que la première ligne concerne les entĂŞtes de notre fichier csv qui sont en rĂ©alitĂ©s quelques attributs des comptes que nous allons crĂ©er.

Enregistrer votre fichier en tant que c:\users.csv puis utiliser le script ci-dessous pour créer les comptes :

#Bulk users accounts creation

$csv = Import-csv -Path c:\users.csv -Encoding UTF8 -Delimiter ";" 
$path = "OU=SITES,DC=srckoa,DC=local"
$domain = "srckoa.local"
$Password = "YourP@ssw0d"

foreach ($u in $csv) {

    #Creating Organizational Unit
    try {
        New-ADOrganizationalUnit -Name $u.OU -path $path #-WhatIf
    catch {
        Write-Host "OU $($u.OU) ready for receiving user accounts" -ForegroundColor Yellow
    #Creating user account in the previous created orgnizational Unit
    New-ADUser -Name $u.DisplayName`
        -GivenName $u.GivenName`
        -Surname $u.surname`
        -SamAccountName $u.samAccountName`
        -UserPrincipalName $($u.givenName + "." + $u.surname + "@$domain")`
        -Department $u.Department`
        -DisplayName $u.DisplayName`
        -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force)`
        -Path ("OU=" + $u.OU + "," + $path)`
        -Enabled $true `
        -ChangePasswordAtLogon $true


Ce script va crĂ©er les comptes utilisateurs dans les unitĂ©s d’organisations qui sont indiquĂ©es dans la colonne OU. Toutes les crĂ©ations vont se faire sous une OU racine appelĂ©e SITES que nous avons indiquĂ©e dans le script.

Une démo est disponible ici :

How to grant read-only permission on a MailBox

In this post I will show you how to grant user Perry Brill read-only permission on the mailbox of Joe Dan using PowerShell.

The first thing to do is to find all the folders present in Serge Boss mailbox then grant read only permission on those folders to John Doe.

Let’s go with the fistr step :

To find the folders in the mailbox, use the below commandline

Get-MailboxFolderStatistics -Identity <mailbox identity> | Select-Object Identity

To grant access to a particular folder, use this commandline

Add-MailboxFolderPermission -Identity <Folder Identity> -User <User who needs access> -AccessRights <Type of Access>

To grant read-only access to all the folders, you must apply the previous command to all the folder. The easiest way is to use a loop. I propose you a function to reach that goal.

function Add-PermissionOnAllMailboxFolders {
    param (
        [Parameter(Mandatory = $true)]

        [Parameter(Mandatory = $true)]

        [Parameter(Mandatory = $true)]
        [validateSet("Author","Reviewer","Contributor")] #Find complete list of permission on

    $ExcludeFolders = ":\Top of Information Store",":\Recoverable Items",":\Audits",":\Calendar Logging",":\Deletions",":\DiscoveryHolds",":\Purges",":\SubstrateHolds",":\Versions",":\Sync Issues",":\Yammer Root"
    $alias = (Get-Mailbox -Identity $Identity).alias
    Add-MailboxFolderPermission "$($alias):\" -User $User -AccessRights $AccessRights

    (Get-MailboxFolderStatistics -Identity $alias).Identity | Foreach-object {
        $folder = $_.replace("$alias\","$($alias):\")
        if ($folder.replace("$alias","") -notin $ExcludeFolders) {
            Add-MailboxFolderPermission $folder -User $User -AccessRights $AccessRights


Run the script to load the function and then use the commands below to grant the permissions according to your need

To grant read-only permission

#Reviewer : FolderVisible, ReadItems
Add-PermissionOnAllMailboxFolders -Identity "Joe Dan" -User "Perry Brill" -AccessRights Reviewer

To grant the other type of permission

#Author : CreateItems, DeleteOwnedItems, EditOwnedItems, FolderVisible, ReadItems
Add-PermissionOnAllMailboxFolders -Identity "Joe Dan" -User "Perry Brill" -AccessRights Author

#Contributor : CreateItems, FolderVisible
Add-PermissionOnAllMailboxFolders -Identity "Joe Dan" -User "Perry Brill" -AccessRights Contributor

Now you can add the mailbox to the user Outlook and access it content

The mailbox now appears in your outlook.

Directly assigned or Inherited Office 365 Licenses ?

Hello, today I am sharing with you an interesting Office 365 script that I hope will help you. This script will tell you how licenses are assigned to a set of user in your Office 365 tenant : Direct or Inherited ?

My script consists of 2 parts, the first determines License Plans assigned to a user account, the second one dertermines the Licenses paths (Direct or Inherited).

function Get-LicensePlan {

    param (




                      "$($TenantName):AAD_PREMIUM" {return "AAD Premium P1"}
                   "$($TenantName):AX7_USER_TRIAL" {return "D_AX7.0 TRIAL"}
          "$($TenantName):DYN365_ENTERPRISE_P1_IW" {return "D365 ETR P1"}
              "$($TenantName):DYN365_RETAIL_TRIAL" {return "D365 CRM TRIAL"}
                              "$($TenantName):EMS" {return "EMS_E3"}
                       "$($TenantName):EMSPREMIUM" {return "EMS_E5"}
                     "$($TenantName):DESKLESSPACK" {return "F1"}
                     "$($TenantName):STANDARDPACK" {return "E1"}
                   "$($TenantName):ENTERPRISEPACK" {return "E3"}
                "$($TenantName):ENTERPRISEPREMIUM" {return "E5"}
                        "$($TenantName):FLOW_FREE" {return "FLOW FREE"}
                      "$($TenantName):INTUNE_A_VL" {return "INTUNE"}
                       "$($TenantName):MCOMEETADV" {return "SFB PSTN Conf"}
        "$($TenantName):MICROSOFT_BUSINESS_CENTER" {return "MBC"}
                     "$($TenantName):POWER_BI_PRO" {return "PBI PRO"}
                "$($TenantName):POWER_BI_STANDARD" {return "PBI STD"}
        "$($TenantName):POWERAPPS_INDIVIDUAL_USER" {return "PAPPS IND User"}
                  "$($TenantName):POWERAPPS_VIRAL" {return "PAPPS and LOGIC FLOW"}
                   "$($TenantName):PROJECTPREMIUM" {return "PJ Online"}
                           "$($TenantName):STREAM" {return "STREAM"}
                "$($TenantName):VISIOONLINE_PLAN1" {return "VISIO P1"}
              "$($TenantName):WACONEDRIVESTANDARD" {return "OD P1"}
                      "$($TenantName):WIN_DEF_ATP" {return "WDF ATP"}
                                           default {return $SkuId.Replace("$($TenantName):","")}


With the function Get-LicensePlan, we know what licenses are assigned to a user based on the SkuId. The following second function Get-LAPATH (Get-LicenseAssingmentPaths) will tell us if the licenses are Direct assigned or Inherited from a group.


function Get-LAPATH{

        [Parameter(Mandatory=$true, ValueFromPipeline=$true)]

        Write-Host "## Data processing stated at $(Get-date)" -ForegroundColor Yellow
        Write-Host ""
        $TenantName = ((Get-MsolAccountSku).AccountSkuId[0] -split(':'))[0]

        Write-Host ""
        Write-Host "Working on $UPN" -ForegroundColor Green
        $User = Get-MsolUser -UserPrincipalName $UPN

        #Getting assignment paths
        $LicensesTab = $null
        $LicensePlan = $null
        $LicTabCount = 0
        $LicensesTab = $User.Licenses | Select-Object AccountSkuId, GroupsAssigningLicense


            Write-Host "License Enabled : True" -ForegroundColor Yellow

            $i = 0 #(Measure-Object -InputObject $LicensesTab).Count
            $LicTabCount = $LicensesTab.AccountSkuId.Count


                #Getting License Plan
                $LicensePlan = Get-LicensePlan -SkuId $LicensesTab[$i].AccountSkuId -TenantName $TenantName

                #Getting License Paths
                [System.Collections.ArrayList]$LicensePath = @()


                    foreach ($Guid in $LicensesTab[$i].GroupsAssigningLicense.guid){

                        if($Guid -eq $User.ObjectId.Guid){
                            $LicensePath.Add("Direct") | Out-Null
                            $LicensePath.Add((Get-MsolGroup -ObjectId $Guid).DisplayName) | Out-Null

                    $LicensePath.Add("Direct") | Out-Null

                Write-Host "$LicensePlan : $([String]::Join(",",$LicensePath.ToArray()))" -ForegroundColor Yellow

            While ($i -ne $LicTabCount)
        else {
            Write-Host "License Enabled : false" -ForegroundColor Red

        Write-Host ""
        Write-Host "## Data Processing ended on $(Get-Date)" -ForegroundColor Yellow


Now that everything is set, let’s talk about how to use this script to achieve your goal. Of course, for running this script, you need to have Microsoft Online Services PowerShell installed on your computer (PowerShell Module For Office 365) and a read access permissions on your Office 365 Admin portal to see users configuration,  ideally User Management Role.

  • To see Office 365 license assginment paths for one user
"<UserPrincipalName>" | Get-LAPATH


The user has 3 licenses plans assigned:

  1. FLOW FREE inherited from the license group GRP-FLOW-FREE
  2. FLOW FREE directly assigned
  3. DEVELOPERPACK directly assigned
  • To see Office 365 license assignment paths for several users 

From a Powershell table

"<User1 upn>" ,"<User2 upn>","..." | Get-LAPATH


From a file containing the list of UserPrincipalName :


Get-Content -Path <File path.txt> | Get-LAPATH


Et voilà 🙂

Microsoft Teams – Unable to create Team from existing Group

Hello, I share with you in this post a workaround to create a Team in Microsoft Teams from an existing group.

Open an Exchange Online PowerShell and run this command line to get the InboxUrl of the group you want to create a Team from.

Get-UnifiedGroup -Identity <Your UnifiedGroup Identity> | Select InboxUrl


Use a browser and connect to the InboxUrl of the UnifiedGroup (OWA). In the mailbox, select the group header and open the associated SharePoint site.


This action provisions the SharePoint Site, now you can create a Team


If you see the below error, don’t worry, refresh the browser.


The Teams has been provisioned.


Click to open Teams


You are done !

Exchange Online Powershell module installation error – Application cannot be started. Contact the application vendor

This morning when trying to install the PowerShell Module for Exchange Online from the ECP,

Install Exchange Online PowerShell

I came accross this error message

Exchange Online - Cannot Start Application

Even though this is not a very serious issue, it may cause you lose your time.

So to avoid this error message, use INTERNET EXPLORER to connect to the ECP and then the INSTALLATION WILL BE POSSIBLE.

Thank you.