Answered by:
Get-MsolUser Including inherited license based group

Question
-
hello, is there a way i can run the get-msoluser which will show the inherited license based group? I've been struggling with this for days and was wondering if its possible to get this data for each user. i have a set of users from a csv and i want to extract their information including the license based group.
Any help will be appreciated.
Friday, February 8, 2019 9:47 AM
Answers
-
Do you want licenses or groups? Groups are like AD security groups. Licenses are not groups. Licenses can be assigned to a group so you need to look at the groups with licenses and the users in the group.
See: https://www.jijitechnologies.com/blogs/how-to-list-all-o365-users-with-license-type-using-powershell
\_(ツ)_/
- Proposed as answer by LeeSeenLiMicrosoft contingent staff Thursday, February 28, 2019 2:43 PM
- Marked as answer by vintagevintage Thursday, February 28, 2019 2:50 PM
Friday, February 8, 2019 7:20 PM
All replies
-
Please post your code and any errors.
\_(ツ)_/
Friday, February 8, 2019 10:06 AM -
Hi Jrv,
This is the command i am using. i can see the license but i dont know the command to view the license groups.
import-csv 'C:\users\\directusers.csv' |foreach { get-msoluser -UserPrincipalName $_.userprincipalname| select userprincipalname, islicensed ,@{name ="license";expression={$_.licenses.accountskuid} } } |export-csv 'C:\users\desktop\New folder\FilteredResult.csv' -NoTypeInformation
i have tried using get-msolgroup along with it but i keeps displaying an error everything i use get-msolgroup with the script.- Edited by vintagevintage Friday, February 8, 2019 12:35 PM
Friday, February 8, 2019 10:25 AM -
Do you want licenses or groups? Groups are like AD security groups. Licenses are not groups. Licenses can be assigned to a group so you need to look at the groups with licenses and the users in the group.
See: https://www.jijitechnologies.com/blogs/how-to-list-all-o365-users-with-license-type-using-powershell
\_(ツ)_/
- Proposed as answer by LeeSeenLiMicrosoft contingent staff Thursday, February 28, 2019 2:43 PM
- Marked as answer by vintagevintage Thursday, February 28, 2019 2:50 PM
Friday, February 8, 2019 7:20 PM -
Hi,
Was your issue resolved?
If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
If no, please reply and tell us the current situation in order to provide further help.
Best Regards,
LeeJust do it.
Monday, February 11, 2019 6:49 AM