767 PowerShell for Microsoft 365 Migrations
767 PowerShell for Microsoft 365 Migrations
Discover how PowerShell can be a game-changer for Microsoft 365 migrations, offering speed and capabilities beyond the standard portal, and…
Feb. 15, 2025

767 PowerShell for Microsoft 365 Migrations

Discover how PowerShell can be a game-changer for Microsoft 365 migrations, offering speed and capabilities beyond the standard portal, and learn practical tips for leveraging scripts in your IT tasks. Embrace the command line!

Uncle Marv shares his recent experience migrating mailboxes and data files to SharePoint Online and Microsoft 365 for a referral client. The project, involving 14 mailboxes for 10 users, presented challenges such as limited access to the previous hosting environment and mailboxes exceeding size limits. Marv highlights how PowerShell became essential for overcoming these obstacles, performing tasks more efficiently than the Microsoft 365 portal would allow. He emphasizes that while the portal is task-oriented, PowerShell’s object-oriented nature provides greater flexibility and speed, especially when dealing with multiple mailboxes or complex configurations.

Marv provides practical advice for those new to using PowerShell with Exchange Online, including running PowerShell as an administrator, using a dedicated admin account with multi-factor authentication, and keeping the Exchange Online management module updated. He also shares specific scripts he used during the migration, such as those for gathering mailbox information, enabling auto-expanding archives, and removing "prohibit send receive" statuses. Marv encourages listeners to download the scripts he used, test them out, and provide feedback for improvement.

Why Listen:

This episode provides valuable insights into how PowerShell can streamline Microsoft 365 migrations and other IT tasks. Whether you're new to PowerShell or looking to expand your scripting skills, you'll gain practical knowledge and actionable tips to improve your efficiency and effectiveness.

What You'll Learn:

  • Why PowerShell is often better and faster than the Microsoft 365 portal for certain tasks.
  • Best practices for connecting to Exchange Online using PowerShell.
  • How to use PowerShell scripts to gather mailbox information and manage mailbox settings.
  • How to enable auto-expanding archives and resolve mailbox quota issues using PowerShell.
  • The importance of embracing PowerShell as a valuable tool in the modern IT landscape.

Actionable Tips:

  • Always run PowerShell as an administrator for necessary permissions
  • Use a dedicated admin account with multi-factor authentication for enhanced security
  • Regularly update the Exchange Online management module
  • Start with basic PowerShell scripts and gradually expand your knowledge

Links:

=== SPONSORS

=== MUSIC LICENSE CERTIFICATE: Envato Elements Item 

=== Show Information

Transcript

Hello friends, Uncle Marv here with another episode of the IT Business Podcast, the show for IT professionals and managed service providers, where we help you run your business better, smarter and faster. Well, I'm coming to you with a quick episode. I wanted to try to get a couple of things out that I had mentioned in earlier podcasts.

And today I talked about a set of PowerShell scripts that I had been using during my SharePoint migration. And I wanted to get a couple of things, one feedback on the scripts that I got, because these are all things that I went out and found and played around with and tweaked on my own. And then of course, I know that many of you are much better at PowerShell than I am.

So if you download the sheet that I'm going to make available from the website and see that there are additional scripts that I should have in my repertoire, I would like to get those. So first I want to describe the process here as related to that SharePoint migration. If you've been following me, let me give you a quick update.

This is a referral client. So they're not my client, but I'm doing a one-off project for them where we're migrating mailboxes from a hosted exchange server with a previous service provider that is hosting their environment in the cloud. So they are remoting into a server and that's where all their stuff is.

So we're migrating all of their data files to SharePoint Online. We're migrating their mailboxes from hosted exchange and moving them into 365. There is a quasi-internal IT person that I am working with.

He has helped them with all of their stuff. Like I said, it's only 10 users, although we're migrating 14 mailboxes. And he's going to actually take care of making sure the users get the correct software downloaded from the portal and that they have access and all of that stuff.

My job is just to do the migration. But of course, we ran into snags along the way. Some of them by the previous host provider not giving us access into their exchange environment, not getting us access onto their current server where we needed to install the SharePoint migration agent.

And then actually we needed to go in and find out sizes of mailboxes because during the migration, we had four mailboxes that we found out were bigger than the 50-gig limit. So then we had to add some licensing to get those primary mailboxes up to 100 gig. And then we actually did the auto-expanding archive to the 1.5 terabyte.

And those were things that I really could not figure out how to do in the portal and just, you know, resigned myself to the fact that there are things that are not able to be done in the portal that are done either through PowerShell scripts or that even if you can do it in the portal, it's faster. By using the PowerShell. So that's the first thing that I probably should just admit that, you know, PowerShell in a lot of ways is just simply better and faster in some areas.

Obviously, the GUI, the portal is task-oriented and PowerShell is object-oriented. So that's one of the things that I really learned over this past month, you know, and an example would be, you know, in the portal, you can create a mailbox, but if you need to create, you know, multiples like 500, doing it in a script is much better. Now, I've never had to do 500 mailboxes.

In fact, I think the most I've ever had to do was 40-something. And some of it we did manually with scripts, but I never did them through a true PowerShell environment completely. So that's one of the things that I was getting into.

So I'm not a scripting guru, but the scripts that I put in the PDF are ones that I have found and got me going in the right direction. Probably the first thing that I had to get past was being able to connect to Exchange Online from PowerShell. So some best practices for anybody that has not done it yet and you're thinking of doing that, first thing is you've got to run PowerShell as an administrator.

You've got to know the global admin address that you're using to connect. The PowerShell scripts that I have, there's two versions. There's one just to connect, and then there's one that actually will help install the Exchange Online management module, and that's something that needs to be updated.

I think the one I have is for version 3.4.0, and I think there is, yeah, the latest version is 3.6.0. That is what, you know, under general availability release. There is a newer version, 3.7, but there were a lot of errors reported in that. So my script says 3.4, but I know the latest version is 3.6, which is what I think got installed when I was doing my thing.

To finish off the best practices when you're doing this, also make sure that you're using a dedicated admin account and have multi-factor authentication active on that. So those are the things that, just to get started, to make sure that you know. The things that I was doing with the script was obviously after connecting, I was grabbing mailbox information, and that was something that was very quick to do on gathering data on multiple mailboxes, going into the portal just to find, you know, the usage reports.

It's click, click, click, go to page, go to page. If you've got your script set up ahead of time, it just pulls it all down pretty good. It goes beyond the basics with filtering.

There's a lot of filters that could be done. And it was just actually pretty cool learning to do the PowerShell stuff. And as I mentioned earlier, I had to enable the auto-expanding archive using the PowerShell script.

So that's what I had to do there. And when I was able to go back and change the licensing for the four mailboxes that were over 50 gigs, I actually, when I went to go restart the migration, the mailboxes were still showing the 50 gig limit. And so there was a prohibit send receive status on it.

So I had to go out and find a script to remove that because I could not find out how to do it in the portal. So one of the scripts is how to remove that status and then verify that the quotas had been changed to, you know, 100 gig instead of the 50 gig. So there's a status script to check that out.

So that's pretty much it. I don't want to get too much into detail. But again, the link for the PDF that I have is going to be in the show notes.

It's a long link. It's itbusinesspodcast.com slash downloads slash 365 Exchange PowerShell. But I'll have a link in there so you can go and grab that.

If you have any questions, have any comments, again, if you have other scripts that you think would be useful to have on a regular basis, let me know. If I have anything wrong in the scripts, they all seem to work for me. But if there's something that maybe you can tweak to make it better, I want to know that as well.

So send me an email, Marvin at itbusinesspodcast.com. Head over to the contact us page on the website or ping me in any of the social medias. And I will just leave you with a note here. When Windows 3.1.1 came out and the idea of using a mouse came up, I was one of those people was like, I'm not using a mouse.

I will use a keyboard because real techs use keyboards. And here we are now, you know, 30 years later. And, you know, we're at the point where so much of what we do is in a web portal with a mouse.

And we're now getting back to you got to use a script, got to use a keyboard. So kind of interesting how life circles in a lot of areas. So PowerShell is your friend.

And even though it might seem intimidating, there are basic scripts that you can learn and get that will save you tons of times of effort or tons of time and effort, which is what I've been going through the last month. So download the scripts, try them, give me your feedback. And that's going to do it, folks.

Thanks for listening. I'll see you soon. And until next time, holla!