
Explanation:
Ensure that User1 can invite the contoso.com users to Teams: Assign the Guest Inviter role to User1
* Assigning the Guest Inviter role ensures that User1 has the necessary permissions to invite external users, such as those from contoso.com, to Microsoft Teams.
Ensure that only the contoso.com users can be invited as guests to the Microsoft Entra tenant: From the External collaboration settings, edit the Guest user access restrictions settings
* Modifying the Guest user access restrictions settings under External collaboration ensures that only users from specific domains, like contoso.com, can be invited as guests to the Microsoft Entra tenant.