https://github.com/rakheshster/powershell-graphlicensing
Manage Entra ID licensing using Graph & PowerShell
https://github.com/rakheshster/powershell-graphlicensing
console-tool entraid graph license license-management licensing powershell toolkit
Last synced: 7 months ago
JSON representation
Manage Entra ID licensing using Graph & PowerShell
- Host: GitHub
- URL: https://github.com/rakheshster/powershell-graphlicensing
- Owner: rakheshster
- License: bsd-3-clause
- Created: 2024-09-20T20:54:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-08T10:07:38.000Z (over 1 year ago)
- Last Synced: 2025-07-29T03:05:57.088Z (7 months ago)
- Topics: console-tool, entraid, graph, license, license-management, licensing, powershell, toolkit
- Language: PowerShell
- Homepage:
- Size: 17.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Graph Licensing Toolkit
Source code of a module I created for managing Entra ID licensing via Graph.
You can install the module [from PowerShell Gallery](https://www.powershellgallery.com/packages/Graph.Licensing/).
Tested on macOS, Linux, and Windows with PowerShell 7.4. Should work on other OSes too with PowerShell 7.x and above. It currently has the following cmdlets:
- `Get-MgAssignedLicenses` - view licenses (and plans) assigned to a user or group
- `Update-MgAssignedLicensePlans` - update the plans of a specific license assigned to a user or group
- `Add-MgAssignedLicense` - assign a license to a user or group
- `Get-MgAvailableLicenses` - view all licenses available in the tenant
## Pre-requisite modules
This modules depends upon the following.
- "Microsoft.Graph.Authentication"
- "Microsoft.Graph.Groups"
- "Microsoft.Graph.Users"
- "Microsoft.Graph.Identity.DirectoryManagement"
- "Microsoft.PowerShell.ConsoleGuiTools"
If it weren't for these, this module wouldn't exist! Thank you 😍 to the creators of these, especially `Microsoft.PowerShell.ConsoleGuiTools` which is what I use to drive things. 🙏
```
Install-Module "Microsoft.Graph.Authentication", "Microsoft.Graph.Groups", "Microsoft.Graph.Users", "Microsoft.Graph.Identity.DirectoryManagement", "Microsoft.PowerShell.ConsoleGuiTools"
```
## Screenshots
`Get-MgAvailableLicenses`

Selecting one or more of the licenses above (use `SPACE` key to make selections, followed by the `ENTER` key to confirm) will go through each of the selections and first show the users directly assigned to it.

Followed by the groups directly assigned to it.

In either screen (users or groups), selecting one or more entries (use `SPACE` key to make selections, followed by the `ENTER` key to confirm) will then go through each of the selections and show the plans.

There are cmdlets to directly query a group or user rather than go the route above.
It is also possible to modify the plan assignments.
`Update-MgAssignedLicensePlans -UserPrincipalName $UPN -SkuName $SkuName` or `Update-MgAssignedLicensePlans -GroupName $GroupName -SkuName $SkuName`

After making the selections:

Confirm. Via `Get-MgAssignedLicenses -GroupName $GroupName -SkuName $SkuName` or `Get-MgAssignedLicenses -UserPrincipalName $UPN -SkuName $SkuName`
