Atreidae / UcmPSTools

A collection of Teams Unified Communications related PowerShell functions as part of the UcmPSTools PowerShell Module.
MIT License
6 stars 1 forks source link

Enable-UcmO365Service returns random errors after enabling MCOStandard service #11

Closed Atreidae closed 3 years ago

Atreidae commented 3 years ago

image

Need to investigate this further, Enable-UCMO365Service was successfully called and returns OK (1) but then returns 2 unknown errors to the pipeline (2, 3)

Double checked the user both in OAC and PowerShell and the app is correctly assigned. Admin Portal image

Native powershell image

Atreidae commented 3 years ago

Upon running Test-UCMO365ServicePlan manually, it throws a ton of write warning errors as its referencing the old cmdlet name image

However, this isn't called after setting the licence, so is not related. The error message text matches the $AppEnabled flag test on line 165, I suspect we are stuck in a return loop.

Atreidae commented 3 years ago

Fixed Test-UCMO365ServicePlan Write-Log Cmdlet references, but still has issues returning result. opening new issue #12

Atreidae commented 3 years ago

This issue was caused by a few things.

  1. The cmdlet didn't actually check if we changed any services before attempting to write the changes back to O365 service plan so when a user had multiple licences (which is common) the cmdlet would throw an error for every serviceplan (licence) that didn't contain the required service

  2. The Service was already enabled, thus there was nothing to "set"

  3. The service isn't available in the assigned serviceplans

I've added a better error message indicating this as well as checks to see if we actually changed things before trying to write to Office365. This should also in theory improve the performance of this cmdlet considerably.

Atreidae commented 3 years ago

Fixed in #14