Skip to content

Commit 60dc4a8

Browse files
authored
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
1 parent e23fbc0 commit 60dc4a8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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
@@ -142,15 +142,15 @@ The following example updates a user with **SPE_E5** (Microsoft 365 E5) and turn
142142
```powershell
143143
## Get the services that have already been disabled for the user.
144144
$userLicense = Get-MgUserLicenseDetail -UserId "[email protected]"
145-
$userDisabledPlans = $userLicense.ServicePlans | `
145+
$userDisabledPlans = @($userLicense.ServicePlans | `
146146
Where ProvisioningStatus -eq "Disabled" | `
147-
Select -ExpandProperty ServicePlanId
147+
Select -ExpandProperty ServicePlanId)
148148
149149
## Get the new service plans that are going to be disabled
150150
$e5Sku = Get-MgSubscribedSku -All | Where SkuPartNumber -eq 'SPE_E5'
151-
$newDisabledPlans = $e5Sku.ServicePlans | `
151+
$newDisabledPlans = @($e5Sku.ServicePlans | `
152152
Where ServicePlanName -in ("SWAY", "FORMS_PLAN_E5") | `
153-
Select -ExpandProperty ServicePlanId
153+
Select -ExpandProperty ServicePlanId)
154154
155155
## Merge the new plans that are to be disabled with the user's current state of disabled plans
156156
$disabledPlans = ($userDisabledPlans + $newDisabledPlans) | Select -Unique

0 commit comments

Comments
 (0)