cadcas.blogg.se

Remove office 365 license from computer
Remove office 365 license from computer











$licenses = New-Object -TypeName .AssignedLicenses $Skus = $userList | Select -ExpandProperty AssignedLicenses | Select SkuID $userList = Get-AzureADUser -ObjectID $userUPN To remove all of the licenses for a specific user account, specify the user sign-in name, remove the "" characters, and run these commands. Set-AzureADUserLicense -ObjectId $userUPN -AssignedLicenses $license $license.RemoveLicenses = (Get-AzureADSubscribedSku | Where-Object -Property SkuPartNumber -Value $planName -EQ).SkuID

remove office 365 license from computer

$license = New-Object -TypeName .AssignedLicenses Next, get the sign-in name of the account for which you want to remove a license, also known as the user principal name (UPN).įinally, specify the user sign-in and license plan names, remove the "" characters, and run these commands. Get-AzureADSubscribedSku | Select SkuPartNumber Next, list the license plans for your tenant with this command. For more information, see Migrate your apps to access the license managements APIs from Microsoft Graph. Please migrate your scripts to the Microsoft Graph SDK's Set-MgUserLicense cmdlet as described above. The Set-AzureADUserLicense cmdlet is scheduled to be retired. Use the Azure Active Directory PowerShell for Graph module For more information, see Delete and restore user accounts with PowerShell.

remove office 365 license from computer

$user = Set-MgUserLicense -UserId $user.UserPrincipalName -RemoveLicenses $licencesToRemove -AddLicenses way to free up a license is by deleting the user account. $licencesToRemove = $user.AssignedLicenses | Select -ExpandProperty SkuId Select UserPrincipalName,DisplayName,AssignedLicenses ConsistencyLevel eventual -CountVariable licensedUserCount -All ` Set-MgUserLicense -UserId -RemoveLicenses -AddLicenses remove all licenses from a group of existing licensed users, use the following syntax: $licensedUsers = Get-MgUser -Filter 'assignedLicenses/$count ne 0' ` To remove licenses from an existing user account, use the following syntax: Set-MgUserLicense -UserId "" -RemoveLicenses -AddLicenses example removes the SPE_E5 (Microsoft 365 E5) licensing plan from the user $e5Sku = Get-MgSubscribedSku -All | Where SkuPartNumber -eq 'SPE_E5'

remove office 365 license from computer

View account license and service details with PowerShell View licenses and services with PowerShell To view the licensing plan information in your organization, see the following topics: The permission scope is required to read the licenses available in the tenant. Use the Microsoft Graph PowerShell SDKįirst, connect to your Microsoft 365 tenant.Īssigning and removing licenses for a user requires the permission scope or one of the other permissions listed in the 'Assign license' Graph API reference page. For a list of additional resources, see Manage users and groups.

remove office 365 license from computer

Learn how to remove licenses from user accounts with the Microsoft 365 admin center.













Remove office 365 license from computer