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.

14 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. RC is the Dubai movers company that provides a stress-free service of Movers in Dubai, Abu Dhabi and Sharjah. We give assured service without any household items damages. We provide all the relevant and necessary details at affordable prices. We have good workers of moving services who can give you a safe and secure service within a limited time period. If you need moving services then call us.

    ReplyDelete
  6. 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
  7. 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
  8. MOVERS PACKERS DUBAI is made moving easy and saves Furniture movers Abu Dhabi. We have experience of moving jobs they are well aware of packing, loading, and unpacking procedures. We help in the entire relocation process and we have professionally employed that can save your time and your money with self-confidence.

    ReplyDelete
  9. This type of message always inspiring and I prefer to read quality content, so happy to find a good place to many here in the post, the writing is just great, thanks for the post.
    For more details visit my site:
    Movers and Packers London
    http://movingandpackingexperts.co.uk/

    ReplyDelete
  10. I don’t think many of websites provide this type of information. house removals company

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

    ReplyDelete
  12. 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