13 January 2017

Convert to Shared Mailbox | Office 365 | Script

Thanks to my colleague Gareth Harris for this script.

I have recently been running a few large-scale (1000+ mailboxes) and I've had to rely on scripts for assigning licenses and converting mailboxes to shared mailboxes etc.

This blog will cover the script to convert mailboxes to a Shared Mailbox, and then remove any associated Office 365 licenses with that user.


  1. Create a folder on your machine called "Office 365"
  2. Create a CSV file with the header of "UserPrincipalName" and then fill the column up with the UPNs of the mailboxes/accounts that you wish to convert to Shared Mailboxes.  Save this as license.csv
  3. Open Notepad and add the following contents:
    Import-csv "C:\Folder\SubFolder\Office 365\License.CSV" | foreach {
    $UPN = $_.userPrincipalName
    Set-Mailbox $UPN -Type “Shared”
    $MSOLSKU = (Get-MSOLUser -UserPrincipalName $UPN).Licenses[0].AccountSkuId
    }
  4. Save this file as "ConvertToShared.ps1"
Once you have done this, you will need to sign into Office 365 through PowerShell.  To do this, you can head over to this blog and follow the steps here.

Once you've done this, change your directory to the 'Office 365' folder that you had created.  Then run the 'ConvertToShared.ps1' file.  

.\ConvertToShared.ps1

This will then start the process of converting the mailboxes to 'Shared', and will also remove the licenses if there were any assigned.

Thanks to my colleague Gareth Harris for this script.

13 comments:

  1. What a useful instruction! I’d like to recommend you also a great tool for converting and migrating emails from one mailbox to another. Recently I had to convert Netscape mail to Outlook find more details. Converting Netscape Mail to Outlook is a very tricky affair, because Netscape is seriously outdated now, and you cannot import to Outlook any data from it directly. But this utility moved all my messages (even thousands of them) in one click! I’ve never thought it would be so easy. Moreover, it detects damages in mailboxes automatically and still manages to recover emails from them. Highly recommend!

    ReplyDelete
  2. There are various points of interest of utilizing the service of an expert garbage pulling organization, above all and first, you have to guarantee that you pick the service which is directly for you so as to take care of business adequately. london removal companies

    ReplyDelete
  3. AnyConv is a good free file converter that supports lots of file formats. It's really easy to use and lets you convert files online without having to download any software. AnyConv converts between many document, image, video, archive, audio, and CAD formats. https://anyconv.com/

    ReplyDelete
  4. SARA MOVERS is the best movers and packers dubai Abu Dhabi company that is giving you reliable and standard service by professional moving teams.

    ReplyDelete
  5. We are the responsible authorized company of Fridge repair Dubai, Refrigerator repair Dubai, Freezer repair Dubai Abu Dhabi and all over UAE. We have extensive knowledge with over 10 years of experience in this field. We repairing all types of fridge brands and models that do you have. Today Call us now and get satisfaction service with our engineers.
    Refrigerator repair Dubai
    Refrigerator repair Abu Dhabi
    Freezer repair Dubai

    ReplyDelete
  6. SAVE YOUR HOME offering Plumbing services and repair in Dubai by plumbing expert teams. Our teams are one of the best teams of plumbing problems, they have the training and the skills required to carry out these tasks effectively. When you hire our plumber teams then you stand to benefit in several ways. Hurry up call us for plumbing services.
    Emergency plumbing Dubai
    Plumbing services and repair
    Plumbing services and repair in Dubai

    ReplyDelete
  7. one of the very best system I know, thank you extremely considerably MP4 to MP3

    ReplyDelete
  8. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... file storage

    ReplyDelete
  9. idigic is an affiliation that gives purchasers a fundamental strategy for buy twitter allies Australia. The objective of idigic is to give clients the best assistance, gotten along with splendid Twitter fans for their record

    ReplyDelete
  10. idgic au is a social media marketing company that provides a variety of services to help businesses
    grow their social media presence. We buy SoundCloud plays free trial offer a variety of services, including, but not limited to,
    buying and/or boosting likes, followers, and views for various social media platforms.
    We also offer other marketing services, such as website design and development, search engine optimization,
    and content writing.

    ReplyDelete
  11. Downloadable airpods pro vinyl skin cutting on various shaper. most prominent consideration gave, buttons are actually open. The Cut ensures Smooth and basic skin application, especially at changed corners.

    ReplyDelete
  12. Downloadable skin cut templets for vinyl cutting on various shaper. most outrageous incorporation gave, buttons are successfully open. The Cut ensures Smooth and straightforward skin application, especially at changed corners.ps5 gaming console

    ReplyDelete