I have list of users in O365 group, lets name it O365Group (1). And I would like to do some cleaning with it. I found users without license in O365 (2) , but I can't compare it (3) with users from O365Group - I'd like to find any users in O365Group
with has't licenses
(1) get-azureadgroupmember -ObjectId yrc234a6-2876da7-9re7-2fk69c7e2018 -all 1 | sort-object displayname
(2) Get-MsolUser -All | where {$_.isLicensed -eq $true}
(3) Get-MsolUser -All | Where {$_.IsLicensed -eq $false }
foreach ($User in $_.UserPrincipalName)
{
get-azureadgroupmember -ObjectId
yrc234a6-2876da7-9re7-2fk69c7e2018 -all 1 |
where {$_.UserPrincipalName -like "$_.UserPrincipalName"} |
sort-object displayname
}