Logo
Collaborating with External Users in Teams Using Guest Accounts
Teams; Azure AD

Collaborating with External Users in Teams Using Guest Accounts

11 September 2020 By Hal Sclater

This is how to invite external users to work with you in Teams using Guest accounts. Whilst you can use federation in Teams to chat 1-1 with external users, it’s impossible to add an external user to a Team without using Guest accounts.

The process below uses PowerShell to invite guests without sending an invitation email — the invitation is automatically accepted when they click on a link.

Inviting Guest Users via PowerShell

Create a CSV file guestusers.csv:

"DisplayName","UserPrincipalName"
"Jo User","jouser@company.com"

Run the following script:

# Invites Guest users without sending an email invite
$CSVfile = "$PSScriptRoot\guestusers.csv"

Write-Host "Connecting to AzureAD"
Connect-AzureAD

$users = Import-Csv $CSVfile

foreach ($user in $users) {
    $UPN = $user.UserPrincipalName
    $DisplayName = $user.DisplayName
    
    if (Get-AzureADuser | Where-Object {($_.DisplayName -eq $DisplayName) -and ($_.UserType -eq 'Guest')}) {
        Write-Host "Error: $DisplayName Guest already exists" -ForegroundColor Red
        Exit
    } else {
        Write-Host "Inviting $UPN"
        New-AzureADMSInvitation -InvitedUserDisplayName $user.DisplayName -InvitedUserEmailAddress $user.UserPrincipalName -InviteRedirectURL https://myapps.azure.com -SendInvitationMessage $false
    }
}

Create a Team and Add the Users

  1. Go to admin.teams.microsoft.com.
  2. Create a new Team for the project.
  3. Add internal and external (Guest) users as required.

Internal users can access the folder via Teams. You can also send the SharePoint site link if they don’t have Teams installed.