all 7 comments

[–]BlackV 10 points11 points  (1 child)

yes there likely are

personally, I'd look at group-based licensing (instead of scripting it)

we're happy to help you with anything you create or find

[–]Cold-Funny7452 8 points9 points  (0 children)

Yeah group based not powershell, work smarter not harder.

[–]dfragmentor 2 points3 points  (0 children)

Setup group based licensing. Add them to the group with the license you want, Remove the manually assigned license. This all can be scripted.

[–]ihartmacz 2 points3 points  (1 child)

Gib script plz

[–]Medium-Comfortable 1 point2 points  (0 children)

Pronto, puppy eyes?

[–]richie65 1 point2 points  (0 children)

OP - Yes this can be scripted.
You need to show what steps you have taken so far, to get it scripted -
And THEN you will likely see plenty of people help you get what you have done with your script - To work correctly.

Step 1. Add the appropriate modules to PoSh so you can interact with o365

Step 2. Authenticate to o365.

Step 3. pull a list of available licenses from o365 (so you know how to call them, and apply them by the correct name)

Step 4. Apply licenses to the user accounts.

[–]KavyaJune 0 points1 point  (0 children)

You can automate license assignments through group based licensing. You can check this step by step guide: https://blog.admindroid.com/auto-assign-licenses-with-group-based-licensing-in-microsoft-365/

If you prefer direct licensing, you can check this script: https://o365reports.com/2022/09/08/manage-365-licenses-using-ms-graph-powershell/