Wonder if anyone can help...
> I have a txt file containing a list of user principal names.
> I need to return all users if they have a licence and their UPN isn't listed in the TXT file.
#User Import#
$Users = Get-Content C:\Users\NAME\UserImport.txt
#Get All Licensed Users & Filtered
foreach ($Users in $MSOLUsers){
$User = Get-MsolUser -UserPrincipalName $MSOLUser
$users = Get-MsolUser -All | Where-Object {$_.isLicensed -eq $true -and $_.UserPrincipalName -notlike "*$Users*"}
$users.Count
}
Any help appreciated!
Callum