You can do this directly through the Admin Center at https://admin.microsoft.com/
1) Go to Users > Active Users
2) Go to Filter > New Filter
3) Fill out the Filter and choose Assigned product license > Microsoft 365 E3
4) Choose Export users
If this is helpful please accept answer.