3s-gtech Posted October 3, 2023 Posted October 3, 2023 First time I have tried to manually license a new user using Powershell since September. It seems that MS have finally switched off the msol module - at least, I now just get an unspecified error. Great. So, I want to license a M365 user using Powershell, and it looks like I need the MgGraph module now. I have the module installed, but I just get 403 errors when running commands. Does anyone have any idea how I give myself permission to run the commands? The module has had access granted in Entra, but only read as that's what it asked for. Our Salamander install can do this, and I'll probably get it modified to do so, but I always did staff manually due to the faff of constantly coming and going supply teachers. Anyone done this and got a decent guide? I have only found absolute junk online so far.
TRSJon Posted October 3, 2023 Posted October 3, 2023 Maybe not the answer you are looking for, but I gave up on powershell licencing and have it setup to auto assign the licence based on group membership. Does it automatically. Assign licenses to a group - Microsoft Entra | Microsoft Learn 1
midweek Posted October 3, 2023 Posted October 3, 2023 We license by group membership too. Works well.
ThomL Posted October 3, 2023 Posted October 3, 2023 I don't know if this guide is any good, it's the one I've got bookmarked to read at some point: https://www.thelazyadministrator.com/2019/07/22/connect-and-navigate-the-microsoft-graph-api-with-powershell
3s-gtech Posted October 3, 2023 Author Posted October 3, 2023 I've done it. It was to do with scopes - man, I read some absolute **** online to actually cut the junk out. Connect-MgGraph -Scopes "User.Read.All","Group.ReadWrite.All","Directory.ReadWrite.All","Organization.ReadWrite.All" Then authorise the app with Entra via the popup. 1
XiJ Posted October 3, 2023 Posted October 3, 2023 Powershell for MSgraph seems a whole lot more complicated way of doing things. I get the scopes intention but, yeah I had a lot of googling to find what i needed. And some things still require the AzureAd module
3s-gtech Posted October 3, 2023 Author Posted October 3, 2023 Ooh the licensing PS is horrible. It was awful with msoluser to be fair, but it's now just worse. https://learn.microsoft.com/en-us/microsoft-365/enterprise/assign-licenses-to-user-accounts-with-microsoft-365-powershell?view=o365-worldwide This page gives a good illustration of that. I don't need to do it often, but when I do it should be quick any easy.
StevieM Posted October 3, 2023 Posted October 3, 2023 Maybe not the answer you are looking for, but I gave up on powershell licencing and have it setup to auto assign the licence based on group membership. Does it automatically. Assign licenses to a group - Microsoft Entra | Microsoft Learn Wow! That seemed to work quite painlessly, which makes a nice change. Now to sort out password sync and automatic M365 sign in from AD and I'm sorted.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now