On The Practical 365 Podcast this week, MVP and co-host Sigi Jagott interviews Ingo Gegenwarth on the brand new Exchange Online cmdlets which Microsoft announced at Ignite 2019. MVP and Microsoft Certified Master Ingo Gegenwarth is a Practical 365 writer, and an acclaimed expert when it comes to PowerShell and Exchange.
Below is a transcript of their conversation:
Ingo: Why would you need to get this new module? What’s the performance boost?
Firstly, the architecture in the new module is better because it’s going to be stateless. We’ll also be able to see improvements with the cmdlets features, for example, in the properties and the property sets which are now only available for these new cmdlets. Moreover, you can now process a high amount of mailboxes and objects, modify them, query their properties and whatever you need here for your daily administrative tasks.
Sigi: Wow, so is it something that’s coming or something that’s already available this new PowerShell V2 Client module?
Ingo: Well, this is already available, so everybody can go ahead and install it from the PowerShell Gallery.
Sigi: Cool. So why would you want to use the new cmdlets? What’s the history of issues that they solve?
Ingo: Well, one of the most common issues I think almost every Admin in larger environments runs into is you have to gather from a lot of mailboxes properties, or, modify them, or roll out new settings, but you have really long-running sessions. So, the connectivity of these long-running sessions is a real pain, fortunately, this has been addressed in the new module.
Sigi: So basically, you’re saying that when I run a long cmdlet at some point it terminates, correct? As far as I remember it’s always a problem when you run against the Exchange Online service, I get the cmdlet for example and expect 500,000 objects back, but actually it would terminate after a certain amount of time.
Ingo: That’s correct, yes. Usually you would have set up your PowerShell session, and then just think about this scenario – one of the servers has just died, and the session was broken, you had to re-establish everything, and now think about when you have an Admin account which enforces MFA, which everybody should have.
There’s the other module that supports MFA. But even so, if you had the wrong landing session, it uses OWA for connecting for authentication. But the OWA token the access token is only valid for one hour. After this decision terminated they’re most likely to re-establish it, this is what’s really a hassle.
Sigi: OK, yeah, so you mentioned that there will be new EXO cmdlets, but what about the existing Exchange Cmdlets, is there anything you need to consider here?
Ingo: So the good thing is really they’re running side by side. I mean, this was one of the major pieces of feedback we also gave Microsoft and the responsible people. You can’t work with 2 or 3 modules, they are in different shells and that doesn’t work. So the Exchange Version 2 Online module will include the new cmdlets as well as the old ones, so there’s only one place, here you’ll have to download and maintain only one module because you can really only concentrate on the one module and be happy so far.
Sigi: So basically, you’re saying, you can run the new module and use the old cmdlets if you don’t need the new ones, and you won’t see any effect in your scripts correct?
Ingo: Yeah, that’s correct, the only thing is, there’s another thing you have to keep your mind on, currently as of now, we have 8 or 9 cmdlets available here. The old ones are still there, but if you really want to take advantage of the performance booth and the new features for your scripts, then I’d use the new ones, and if you really want to use the old ones, you can. But we definitely recommend using the new ones.
Sigi: OK, so if you use the new ones? What are the are there any implications to using them or is there anything you need to be aware of if you use the new Excel cmdlets?
Ingo: Yeah, even though they’re pretty fast, and we’re going to demonstrate this in the webinar, I’ll share some of my experience here from daily work to explore it further. One of the things for improving performance is also, of course, just returning not all the properties of an object so you have to be very careful. That means you know you can’t expect to retrieve all the properties like the old cmdlets. One the one hand this is good, on the other, there can be an issue.
This means if you really want to look into certain properties of objects, you have to make sure that this is either in the default settings or you have to define it to be returned from the objects.
Sigi: Correct, it might be a little bit confusing if you expect more properties to be returned. Or, if your script that you change requires the objects correct?
Ingo: Correct. Always verify what you’re getting back, first give it a try before you start rewriting your scripts or compare them.