Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

You have Exceeded the Maximum Number of Allowable Transactions Microsoft 365

July 29, 2023
in Blog, Powershell
0
ADVERTISEMENT

Table of Contents

Exceeded the maximum number of allowable transactions

I’ve been using the following script, to bulk assign licenses to multiple users at once for years.

Get-MsolUser -All -UnlicensedUsersOnly | ForEach-Object {
  Set-MsolUserLicense `
  -UserPrincipalName $_.UserPrincipalName `
  -AddLicenses 'M365t66166641:POWER_BI_STANDARD'
}

However, recently I am getting the following error, I’m not sure what is causing it and I have tried over a couple of hours, but the same issue occurs. The licenses do not assign to all users, and I have a couple hundred users without a license.

Set-MsolUserLicense : You have exceeded the maximum number of allowable transactions. Please try again later.
At line:10 char:1
+ Set-MsolUserLicense -UserPrincipalName $upn -AddLicenses $SKU

Entra ID PowerShell Deprecation

Microsoft’s original announcement about the deprecation of the Entra ID and Microsoft Online Services (MSOL) PowerShell modules.

4ibD6zugvQgpci9KjXSHUeaOaWSFPmV1zbXXUhCu85L4IFhAqRa8G3YmNwYl

Assign License to Users using Microsoft Graph

1️⃣ Open Windows PowerShell as administrator then run the following commands to install Microsoft Graph Api PowerShell modules.

##Add Repopsitory
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force
Install-PackageProvider -Name NuGet -Force
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted

##Install modules
Install-Module Microsoft.Graph -Scope CurrentUser -Force
Install-Module MSAL.PS -Scope AllUsers -Force

2️⃣ Use the Connect-MgGraph command to sign in with the required scopes. You’ll need to sign in with an admin account to consent to the required scopes.

Connect-MgGraph -Scopes User.ReadWrite.All, Organization.Read.All
4ibD6zugvQgpci9KjXSHUeaOaWSFPmV1zbXXUhCu85L4IFhAqRa8G3YmNwYl

Note: Finding the right scope can be a bit challenging at the beginning. You can visit this link to get more information about scopes.

3️⃣ Get the list of licenses in your tenant:

PS C:\> Get-MgSubscribedSku | select SkuPartNumber, SkuId, ConsumedUnits

SkuPartNumber       SkuId                                ConsumedUnits
-------------       -----                                -------------
CPC_E_2C_8GB_256GB​ 1c79494f-e170-431f-a409-428f6053fa35             0
CPC_E_2C_4GB_128GB​ 226ca751-f0a4-4232-9be5-73c02a92555e             0
POWER_BI_STANDARD   a403ebcc-fae0-4ca2-8c8c-7a907fd6c235           159
SPE_E5              06ebc4ee-1bb5-47dd-8120-11324bc54e06            22

4️⃣ Finally, bulk assign license for all users using Graph PowerShell instead of MSOL PowerShell.

$Sku = Get-MgSubscribedSku -All | Where SkuPartNumber -eq 'POWER_BI_STANDARD'
$users = Get-MgUser -Filter "assignedLicenses/`$count eq 0 and userType eq 'Member'" `
        -ConsistencyLevel eventual -CountVariable unlicensedUserCount -All

foreach ($user in $users) {
    Set-MgUserLicense -UserId $user.Id `
    -Addlicenses @{SkuId = $Sku.SkuId} `
    -RemoveLicenses @()
}

More Microsoft Graph PowerShell articles

  • Microsoft Graph: Connect To Microsoft Graph API.
  • Microsoft Graph: Create Multiple Users.
  • Microsoft Graph: Get the List of Unlicensed Users.
  • Microsoft Graph: Get a List of all Users with a Specific License.
  • Microsoft Graph: Bulk Delete Microsoft 365 Accounts.
  • Microsoft Graph: Bulk Reset Password Microsoft 365 Accounts.
5/5 - (1 vote)
Previous Post

How to Determine What Microsoft Graph Permissions You Need to Connect

Next Post

How to SSH into Bash and WSL2 on Windows From an External Machine

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory