Please note that “Everyone except external users” (All users except external users) is a group built into the SharePoint codebase rather than a modifiable object.
We cannot modify the membership of “Everyone except external users” as it does not actually have memberships.
Currently, there is no PowerShell script to get only tenant-wide internal users.
As a workaround, you can get the report for all user (including external users) using the "Export Users" feature via Microsoft 365 admin center > Users > Active users > Ellipsis (More actions) > Export Users. Then you can filter out the internal users in the exported CSV file, for example, by filtering "User principal name" field.
In addition, if you want to control which users can have access to SharePoint Online, consider using Conditional Access Policies to control user access instead.
If an Answer is helpful, please click "Accept Answer" and upvote it.
**Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. **