Hi,
Thanks for to the quick reply.
Here is the script in it's simplest form. The full script contains the reset of every method. Currently testing with the phone number only at the moment:
"$azureID = $Context.TargetObject.AzureID
if ($NULL -eq $azureID)
{
$Context.LogMessage("The user does not have a Microsoft 365 account", "Warning")
return
}
$accessToken = $Context.CloudServices.GetAzureAuthAccessToken()
Connect-MgGraph -AccessToken ($accessToken | ConvertTo-SecureString -AsPlainText -Force)
$methods = Get-MgUserAuthenticationPhoneMethod -UserId $azureId
foreach ($method in $methods) {
Remove-MgUserAuthenticationPhoneMethod -UserId $azureId -PhoneAuthenticationMethodId $method.Id
}"
Error message when executing.
"The 'Get-MgUserAuthenticationPhoneMethod' command was found in the module 'Microsoft.Graph.Identity.SignIns', but the module could not be loaded. For more information, run 'Import-Module Microsoft.Graph.Identity.SignIns'. Stack trace: at <ScriptBlock>, <No file>: line 16"
If I add the import-module cmd into the script I then get this:

Here is a screenshot of the MultiServerEnvironment:

Thank you