From 60dc4a8e03a72d1ce88501fc6c655e29c304459a Mon Sep 17 00:00:00 2001 From: Sriraman M S <45987684+msbemba@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:19:57 +0530 Subject: [PATCH] Update disable-access-to-services-with-microsoft-365-powershell.md Made changes to the PS script Fixes https://github.com/MicrosoftDocs/microsoft-365-docs/issues/12333 --- ...le-access-to-services-with-microsoft-365-powershell.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/microsoft-365/enterprise/disable-access-to-services-with-microsoft-365-powershell.md b/microsoft-365/enterprise/disable-access-to-services-with-microsoft-365-powershell.md index e300f04f836..7cbbe7c2324 100644 --- a/microsoft-365/enterprise/disable-access-to-services-with-microsoft-365-powershell.md +++ b/microsoft-365/enterprise/disable-access-to-services-with-microsoft-365-powershell.md @@ -142,15 +142,15 @@ The following example updates a user with **SPE_E5** (Microsoft 365 E5) and turn ```powershell ## Get the services that have already been disabled for the user. $userLicense = Get-MgUserLicenseDetail -UserId "belinda@fdoau.onmicrosoft.com" -$userDisabledPlans = $userLicense.ServicePlans | ` +$userDisabledPlans = @($userLicense.ServicePlans | ` Where ProvisioningStatus -eq "Disabled" | ` - Select -ExpandProperty ServicePlanId + Select -ExpandProperty ServicePlanId) ## Get the new service plans that are going to be disabled $e5Sku = Get-MgSubscribedSku -All | Where SkuPartNumber -eq 'SPE_E5' -$newDisabledPlans = $e5Sku.ServicePlans | ` +$newDisabledPlans = @($e5Sku.ServicePlans | ` Where ServicePlanName -in ("SWAY", "FORMS_PLAN_E5") | ` - Select -ExpandProperty ServicePlanId + Select -ExpandProperty ServicePlanId) ## Merge the new plans that are to be disabled with the user's current state of disabled plans $disabledPlans = ($userDisabledPlans + $newDisabledPlans) | Select -Unique