When creating new accounts, there is always a question of how to provide each user with a password. Since sending them a password always poses a risk, Microsoft’s Self Service Password Reset is the best answer.
By default, new accounts have no authentication methods to use for SSPR. However, you are able to pre-populate a phone number or alternate email address to allow your new users a way to set their password.
NOTE: SSPR features are available in Microsoft 365 Business Standard or higher and all Microsoft Entra ID P1 or P2 SKUs.
Microsoft.Graph Module
Connecting with the necessary permissions is the first step.
# Import the MgGraph module
Import-Module Microsoft.Graph
# Connect to MgGraph with required permissions
Connect-MgGraph -Scopes "User.ReadWrite.All"Populating phone and email properties
There are two properties, “MobilePhone” and “OtherMails” that can be used to enter a user’s alternate contact info.
# Populate a user's mobile phone number
Update-MgUser -UserId user@m365admins.com -MobilePhone "833-123-4567"
# Populate a user's alternate email address
Update-MgUser -UserId user@m365admins.com -OtherMails "user@gmail.com"After populating these properties, a user will then be presented with these authentication options when using SSPR.
