Skip to content

Commit bddc418

Browse files
Merge pull request #12395 from msbemba/patch-1584
Update disable-access-to-services-with-microsoft-365-powershell.md
2 parents d34e714 + 5524dea commit bddc418

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

microsoft-365/enterprise/disable-access-to-services-with-microsoft-365-powershell.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ The following example updates a user with **SPE_E5** (Microsoft 365 E5) and turn
146146
```powershell
147147
## Get the services that have already been disabled for the user.
148148
$userLicense = Get-MgUserLicenseDetail -UserId "belinda@fdoau.onmicrosoft.com"
149-
$userDisabledPlans = $userLicense.ServicePlans | `
149+
$userDisabledPlans = @($userLicense.ServicePlans | `
150150
Where ProvisioningStatus -eq "Disabled" | `
151-
Select -ExpandProperty ServicePlanId
151+
Select -ExpandProperty ServicePlanId)
152152
153153
## Get the new service plans that are going to be disabled
154154
$e5Sku = Get-MgSubscribedSku -All | Where SkuPartNumber -eq 'SPE_E5'
155-
$newDisabledPlans = $e5Sku.ServicePlans | `
155+
$newDisabledPlans = @($e5Sku.ServicePlans | `
156156
Where ServicePlanName -in ("SWAY", "FORMS_PLAN_E5") | `
157-
Select -ExpandProperty ServicePlanId
157+
Select -ExpandProperty ServicePlanId)
158158
159159
## Merge the new plans that are to be disabled with the user's current state of disabled plans
160160
$disabledPlans = ($userDisabledPlans + $newDisabledPlans) | Select -Unique

0 commit comments

Comments
 (0)