In any case, the details of some guest accounts change over their lifetime. On March 2, Microsoft issued documentation for Reset redemption status for a guest user. This doesn’t sound very exciting, but it’s really very interesting because the feature allows tenant administrators to adjust how a guest account is signed into without using the previous technique of removing and recreating an account. The downside of that approach is that access is lost to all the resources available to the guest account like Teams, SharePoint sites, shares to individual documents, and so on. After recreating the account, access must then be regranted for each resource. This process is tedious, especially when the guest features in multiple groups.
Microsoft anticipates that the reset feature will be used in scenarios such as:
The user wants to sign in using a different email and identity provider. In other words, they now have a different account. For instance, the user might have moved companies and wishes to continue working with your company (a common scenario for professionals like IT consultants and lawyers).
The account for the user in their home tenant has been deleted and recreated. Azure AD won’t recognize the link between the guest account and the user’s new account.
The user’s responsibilities have been passed along to another user and they want to assign access to the resources which supported those responsibilities to that user.
Part of the change is performed using the Azure AD portal. The rest is done with PowerShell cmdlets from the Azure AD Preview module, which you can download from the PowerShell Gallery.
Change the Email (Sign-in) Address for a Guest Account
Unlike tenant accounts, guest users don’t use their user principal name to sign in. Instead, they use their email address. To work, the reset feature changes the sign-in name for the guest account and nothing else. The mail user object created in Exchange Online to allow guest users to receive email is also updated.
In this example, I have a guest account for Jacko Winters. The original email address for this account is Flayosc@outlook.com. The guest is a member of multiple teams and shares some SharePoint documents. I want to reassign access to all these resources to another account called Flayosc@yandex.com. It’s an example of the first scenario described above.
The first step is to update the Mail attribute (Email address) for the guest account with the email address you want to use. Do this through the Azure AD portal (Figure 1). The new email address cannot belong to any other mail-enabled object in the tenant, such as another guest account. If it does, Azure AD won’t allow you to update the account.
Figure 1: Updating the email address for a guest account
Moving to PowerShell, connect to Azure AD and get the Azure AD account identifier for the guest account you want to replace.
The next thing to do is check that the values returned from the two commands match. If they do, use the New-AzureADMSInvitation cmdlet to reissue an invitation to the new email address. The identifier for the guest user account is passed in the InvitedUser parameter. The myapps.microsoft.com landing page is a default site showing apps available to a user. Here’s the command I ran:
Update: Given the deprecation of the Azure AD module in June 2023 (and the disappearance of the ResetRedemption parameter from the New-AzureADMSInvitation cmdlet), you should switch to the Microsoft Graph PowerShell SDK. This code is the equivalent using the Get-MgInvitation cmdlet:
Azure AD creates a new invitation to access the resources currently available to the guest account and sends it to the new email address. You’ll see a response like this:
Id : 129c1c12-da99-4879-b258-d14b34601d46
InvitedUserDisplayName :
InvitedUserEmailAddress : Flayosc@yandex.com
SendInvitationMessage : True
InviteRedeemUrl : https://login.microsoftonline.com/redeem?rd=https%3a%2f%2finvitations.microsoft.com%2fredeem%
2f%3ftenant%3db662313f-14fc-43a2-9a7a-d2e27f4f3478%26user%3d129c1c12-da99-4879-b258-d14b34601
d46%26ticket%3dLStZd8uAONAIbLNIZyfaUZ91VsRczLbzqbFOeHsonSE%253d%26ver%3d2.0
InviteRedirectUrl : http://myapps.microsoft.com/
InvitedUser : class User {Id: 558d8cbb-a5a2-4ea1-b950-0d0748ca5634
OdataType: }
InvitedUserMessageInfo : class InvitedUserMessageInfo {
CcRecipients: System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.Recipient]
CustomizedMessageBody:
MessageLanguage:
}
InvitedUserType : Guest
Status : PendingAcceptance
ResetRedemption : True
Accepting the Reissued Invitation
The invitation arrives at the email address (Figure 2) and the user can accept the invitation to confirm their credentials (set a password) and create an OAuth consent to allow the tenant to read details of the user’s account (Figure 3).
Figure 2: The invitation from Azure B2B Collaboration arrives at the new email address
Figure 3: Granting consent to access user information
Once the user consents to the permissions, the Azure AD account is updated to set the UserState property to Accepted and write the date of the redemption in UserStateChangedOn. We now have a fully functional guest account again. The important point is that the object identifier and user principal name for the account do not change. The only thing which changes is the mail address associated with the account.
The Azure AD audit log contains details of the issue (Figure 4) and redemption of the invitation. While the activity tab confirms the target address for the invitation, the target tab confirms the guest account.
Figure 4: Azure AD audit records for the reissued invitation
Accessing Resources
In this instance, the guest account has access to several teams and some SharePoint documents. SharePoint access is immediate, including the sites used by Teams. Guest access to Planner also works properly.
After testing that access worked for SharePoint and Planner, I turned to Teams. I expected access to the Teams app to take longer because of the need to complete the process which synchronizes Azure AD with the membership roster used to control access to individual teams. Until this happens, the user is refused access to Teams (Figure 5) and the old email address assigned to the guest account remains visible in Teams (Figure 6). [Note that the display name of the guest account has reverted to Flayosc instead of Jacko Winters]
Figure 5: The guest user can’t get into Teams with the new email address
Figure 6: Details of the old email address still present in the Teams membership roster
Unsurprisingly, because the account information in Teams is now outdated, any attempt to add the guest account as a new member of a team also generates an error (Figure 7).
Figure 7: Error when adding the now-updated Azure AD guest account to a team’s membership
To try to force synchronization, I updated the display name and several other attributes of the Azure AD account. This had no effect, so I added a couple of new users to the group using Teams to force Teams to refresh its membership roster. The updates flowed through to Azure AD, but nothing happened in Teams.
Get-AzureADGroupMember -ObjectId b647d5ff-3bda-4333-b768-7990084569b6
ObjectId DisplayName UserPrincipalName
-------- ----------- -----------------
cff4cd58-1bb8-4899-94de-795f656b4a18 Tony Redmond Tony.Redmond@office365itpros.com
b3eeaea5-409f-4b89-b039-1bb68276e97d Ben Owens (Business Director) Ben.Owens@office365itpros.com
a6bfb216-e88c-4f1f-86d7-04747e5fc686 Ben James Ben.James@Office365itpros.com
9ba20686-f869-46e8-85a2-00ec8a035e48 James Joyce James.Joyce@office365itpros.com
acb778e8-f587-45de-ae3a-e76007e043b2 Paul Howett Paul.Howett@office365itpros.com
98dda855-5dc3-4fdc-8458-cbc494a5a774 Sean Landy Sean.Landy@office365itpros.com
6b52fba5-349e-4624-88cd-d790883fe4c4 Ken Bowers Ken.Bowers@office365itpros.com
558d8cbb-a5a2-4ea1-b950-0d0748ca5634 Jacko Winters flayosc_outlook.com#EXT#@office365itpro
Get-AzureADuser -ObjectId 558d8cbb-a5a2-4ea1-b950-0d0748ca5634 | ft mail, displayname, objectid
Mail DisplayName ObjectId
---- ----------- --------
flayosc@yandex.com Jacko Winters 558d8cbb-a5a2-4ea1-b950-0d0748ca5634
The Original email address can’t be used to sign into Teams either. Eventually, after a couple of days, Teams synchronized with Azure AD and the updated account details became visible in Teams. However, the updated account could not sign into Teams.
Come Home to Teams
Working with the Azure AD development group, the problem was diagnosed to due to the way Teams tries its best to bring a user to their home tenant. In the case of guest users, Teams uses the sign in address to locate the tenant and headed off to the wrong place. When using an explicit redirect to the tenant identifier, like https://teams.microsoft.com/?tenantId=c662313f-14fc-43a2-9a7a-d2e27f4f3478, the user can connect.
Obviously, there’s some work for Teams to do to cope when administrators assign new email addresses to guest accounts, but at least the problem is known, and Microsoft will no doubt fix the issue soon.
All this work for a few lines in Chapter 13 of the Office 365 for IT Pros eBook. It just goes to prove how much work and effort the writing team puts in to keeping content accurate, refreshed, and updated. Subscribe now to receive monthly updates of goodness.
1. Are the permissions for B2B limited/locked to just these 3 pieces of information no matter what? Is it possible for a vendor or tenant to request more permission then the following? Also do you know if we can prevent the “photo” from being sent to the “External Tenant”? That seems like possible PII information.
-Name
-Email
-Photo
2. Do you know if it is possible to create an allow-list so that users can only become apart of Organizations as Guests that the home tenant defines? Trying to reduce the wild-west.
You don’t have any control over the tenants someone can join as a guest. Tenants can create a whitelist of the tenants they’ll accept guests from (Azure AD admin center – external identities) but not the other way round. And once someone is a guest, they can update their photo (or the host tenant can update their photo).
Interesting read here, thanks.
Can you change the UPN for the Guest account to remove #EXT#@domainname or is that required for backend AAD purposes as i presume?
I encountered the following errors trying to use this method to change a guest account’s primary email address: New-AzureADMSInvitation : A parameter cannot be found that matches parameter name ‘ResetRedemption’.
It appears that the ResetRedemption parameter has been removed from New-AzureADMSInvitation. If I remove this parameter, I get a different error:
New-AzureADMSInvitation -InvitedUserEmailAddress -SendInvitationMessage $True -InviteRedirectUrl “http://myapps.microsoft.com” -InvitedUser $OldUser
New-AzureADMSInvitation : Error occurred while executing NewAzureADMSInvitation
Code: BadRequest
Message: This user has already been invited to the directory using . If you want to generate a new
invitation link for this user, please call invitation again without the user object.
{"id":null,"mode":"button","open_style":"in_modal","currency_code":"EUR","currency_symbol":"\u20ac","currency_type":"decimal","blank_flag_url":"https:\/\/office365itpros.com\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/blank.gif","flag_sprite_url":"https:\/\/office365itpros.com\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/flags.png","default_amount":100,"top_media_type":"featured_image","featured_image_url":"https:\/\/office365itpros.com\/wp-content\/uploads\/2022\/11\/cover-141x200.jpg","featured_embed":"","header_media":null,"file_download_attachment_data":null,"recurring_options_enabled":true,"recurring_options":{"never":{"selected":true,"after_output":"One time only"},"weekly":{"selected":false,"after_output":"Every week"},"monthly":{"selected":false,"after_output":"Every month"},"yearly":{"selected":false,"after_output":"Every year"}},"strings":{"current_user_email":"","current_user_name":"","link_text":"Virtual Tip Jar","complete_payment_button_error_text":"Check info and try again","payment_verb":"Pay","payment_request_label":"Office 365 for IT Pros","form_has_an_error":"Please check and fix the errors above","general_server_error":"Something isn't working right at the moment. Please try again.","form_title":"Office 365 for IT Pros","form_subtitle":null,"currency_search_text":"Country or Currency here","other_payment_option":"Other payment option","manage_payments_button_text":"Manage your payments","thank_you_message":"Thank you for supporting the work of Office 365 for IT Pros!","payment_confirmation_title":"Office 365 for IT Pros","receipt_title":"Your Receipt","print_receipt":"Print Receipt","email_receipt":"Email Receipt","email_receipt_sending":"Sending receipt...","email_receipt_success":"Email receipt successfully sent","email_receipt_failed":"Email receipt failed to send. Please try again.","receipt_payee":"Paid to","receipt_statement_descriptor":"This will show up on your statement as","receipt_date":"Date","receipt_transaction_id":"Transaction ID","receipt_transaction_amount":"Amount","refund_payer":"Refund from","login":"Log in to manage your payments","manage_payments":"Manage Payments","transactions_title":"Your Transactions","transaction_title":"Transaction Receipt","transaction_period":"Plan Period","arrangements_title":"Your Plans","arrangement_title":"Manage Plan","arrangement_details":"Plan Details","arrangement_id_title":"Plan ID","arrangement_payment_method_title":"Payment Method","arrangement_amount_title":"Plan Amount","arrangement_renewal_title":"Next renewal date","arrangement_action_cancel":"Cancel Plan","arrangement_action_cant_cancel":"Cancelling is currently not available.","arrangement_action_cancel_double":"Are you sure you'd like to cancel?","arrangement_cancelling":"Cancelling Plan...","arrangement_cancelled":"Plan Cancelled","arrangement_failed_to_cancel":"Failed to cancel plan","back_to_plans":"\u2190 Back to Plans","update_payment_method_verb":"Update","sca_auth_description":"Your have a pending renewal payment which requires authorization.","sca_auth_verb":"Authorize renewal payment","sca_authing_verb":"Authorizing payment","sca_authed_verb":"Payment successfully authorized!","sca_auth_failed":"Unable to authorize! Please try again.","login_button_text":"Log in","login_form_has_an_error":"Please check and fix the errors above","uppercase_search":"Search","lowercase_search":"search","uppercase_page":"Page","lowercase_page":"page","uppercase_items":"Items","lowercase_items":"items","uppercase_per":"Per","lowercase_per":"per","uppercase_of":"Of","lowercase_of":"of","back":"Back to plans","zip_code_placeholder":"Zip\/Postal Code","download_file_button_text":"Download File","input_field_instructions":{"tip_amount":{"placeholder_text":"How much would you like to tip?","initial":{"instruction_type":"normal","instruction_message":"How much would you like to tip? Choose any currency."},"empty":{"instruction_type":"error","instruction_message":"How much would you like to tip? Choose any currency."},"invalid_curency":{"instruction_type":"error","instruction_message":"Please choose a valid currency."}},"recurring":{"placeholder_text":"Recurring","initial":{"instruction_type":"normal","instruction_message":"How often would you like to give this?"},"success":{"instruction_type":"success","instruction_message":"How often would you like to give this?"},"empty":{"instruction_type":"error","instruction_message":"How often would you like to give this?"}},"name":{"placeholder_text":"Name on Credit Card","initial":{"instruction_type":"normal","instruction_message":"Enter the name on your card."},"success":{"instruction_type":"success","instruction_message":"Enter the name on your card."},"empty":{"instruction_type":"error","instruction_message":"Please enter the name on your card."}},"privacy_policy":{"terms_title":"Terms and conditions","terms_body":null,"terms_show_text":"View Terms","terms_hide_text":"Hide Terms","initial":{"instruction_type":"normal","instruction_message":"I agree to the terms."},"unchecked":{"instruction_type":"error","instruction_message":"Please agree to the terms."},"checked":{"instruction_type":"success","instruction_message":"I agree to the terms."}},"email":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email address"},"success":{"instruction_type":"success","instruction_message":"Enter your email address"},"blank":{"instruction_type":"error","instruction_message":"Enter your email address"},"not_an_email_address":{"instruction_type":"error","instruction_message":"Make sure you have entered a valid email address"}},"note_with_tip":{"placeholder_text":"Your note here...","initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"empty":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"not_empty_initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"saving":{"instruction_type":"normal","instruction_message":"Saving note..."},"success":{"instruction_type":"success","instruction_message":"Note successfully saved!"},"error":{"instruction_type":"error","instruction_message":"Unable to save note note at this time. Please try again."}},"email_for_login_code":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email to log in."},"success":{"instruction_type":"success","instruction_message":"Enter your email to log in."},"blank":{"instruction_type":"error","instruction_message":"Enter your email to log in."},"empty":{"instruction_type":"error","instruction_message":"Enter your email to log in."}},"login_code":{"initial":{"instruction_type":"normal","instruction_message":"Check your email and enter the login code."},"success":{"instruction_type":"success","instruction_message":"Check your email and enter the login code."},"blank":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."},"empty":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."}},"stripe_all_in_one":{"initial":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"empty":{"instruction_type":"error","instruction_message":"Enter your credit card details here."},"success":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"invalid_number":{"instruction_type":"error","instruction_message":"The card number is not a valid credit card number."},"invalid_expiry_month":{"instruction_type":"error","instruction_message":"The card's expiration month is invalid."},"invalid_expiry_year":{"instruction_type":"error","instruction_message":"The card's expiration year is invalid."},"invalid_cvc":{"instruction_type":"error","instruction_message":"The card's security code is invalid."},"incorrect_number":{"instruction_type":"error","instruction_message":"The card number is incorrect."},"incomplete_number":{"instruction_type":"error","instruction_message":"The card number is incomplete."},"incomplete_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incomplete."},"incomplete_expiry":{"instruction_type":"error","instruction_message":"The card's expiration date is incomplete."},"incomplete_zip":{"instruction_type":"error","instruction_message":"The card's zip code is incomplete."},"expired_card":{"instruction_type":"error","instruction_message":"The card has expired."},"incorrect_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incorrect."},"incorrect_zip":{"instruction_type":"error","instruction_message":"The card's zip code failed validation."},"invalid_expiry_year_past":{"instruction_type":"error","instruction_message":"The card's expiration year is in the past"},"card_declined":{"instruction_type":"error","instruction_message":"The card was declined."},"missing":{"instruction_type":"error","instruction_message":"There is no card on a customer that is being charged."},"processing_error":{"instruction_type":"error","instruction_message":"An error occurred while processing the card."},"invalid_request_error":{"instruction_type":"error","instruction_message":"Unable to process this payment, please try again or use alternative method."},"invalid_sofort_country":{"instruction_type":"error","instruction_message":"The billing country is not accepted by SOFORT. Please try another country."}}}},"fetched_oembed_html":false}
Have MS fixed the teams issue yet? We have a guest user who has been given a new domain and not losing teams access is essential
I just tested and Teams works.
Hi,
1. Are the permissions for B2B limited/locked to just these 3 pieces of information no matter what? Is it possible for a vendor or tenant to request more permission then the following? Also do you know if we can prevent the “photo” from being sent to the “External Tenant”? That seems like possible PII information.
-Name
-Email
-Photo
2. Do you know if it is possible to create an allow-list so that users can only become apart of Organizations as Guests that the home tenant defines? Trying to reduce the wild-west.
You don’t have any control over the tenants someone can join as a guest. Tenants can create a whitelist of the tenants they’ll accept guests from (Azure AD admin center – external identities) but not the other way round. And once someone is a guest, they can update their photo (or the host tenant can update their photo).
Actually in the Azure portal you can define tenants your members are allowed to join. Outbound settings can be configured in https://portal.azure.com/#blade/Microsoft_AAD_IAM/CompanyRelationshipsMenuBlade/CrossTenantAccessSettings. You can block all organizations, and then just allow certain ones if you want to.
Cross-tenant access settings (https://practical365.com/cross-tenant-access-policies/) are a relatively new construct. They didn’t exist when I wrote the original article!
Interesting read here, thanks.
Can you change the UPN for the Guest account to remove #EXT#@domainname or is that required for backend AAD purposes as i presume?
I encountered the following errors trying to use this method to change a guest account’s primary email address: New-AzureADMSInvitation : A parameter cannot be found that matches parameter name ‘ResetRedemption’.
It appears that the ResetRedemption parameter has been removed from New-AzureADMSInvitation. If I remove this parameter, I get a different error:
New-AzureADMSInvitation -InvitedUserEmailAddress -SendInvitationMessage $True -InviteRedirectUrl “http://myapps.microsoft.com” -InvitedUser $OldUser
New-AzureADMSInvitation : Error occurred while executing NewAzureADMSInvitation
Code: BadRequest
Message: This user has already been invited to the directory using . If you want to generate a new
invitation link for this user, please call invitation again without the user object.
It’s an old article at this point (and the Azure AD module is being deprecated by Microsoft). The approach to reset the redemption status for a guest account is now supported in the Azure AD admin center: https://learn.microsoft.com/en-us/azure/active-directory/external-identities/reset-redemption-status
Also, the New-MgInvitation cmdlet supports a ResetRedemption parameter. I have updated the article to reference the new approach.