Configure ADFS with Azure MFA

Sunil Saini 0 Reputation points

while trying to configure ADFS with Azure MFA need to RUN the below script . following the below page

below is the error

Get-MgServicePrincipal : Unable to find target address

Status: 500 (InternalServerError)

Connect-MgGraph -Scopes 'Application.ReadWrite.All'

$servicePrincipalId = (Get-MgServicePrincipal -Filter "appid eq '981f26a1-7f43-403b-a875-f8b09b8cd720'").Id

$keyCredentials = (Get-MgServicePrincipal -Filter "appid eq '981f26a1-7f43-403b-a875-f8b09b8cd720'").KeyCredentials

$certX509 = [System.Security.Cryptography.X509Certificates.X509Certificate2]

$newKey = @(@{

CustomKeyIdentifier = $null

DisplayName = $certX509.Subject

EndDateTime = $null

Key = $certX509.GetRawCertData()

KeyId = [guid]::NewGuid()

StartDateTime = $null

Type = "AsymmetricX509Cert"

Usage = "Verify"

AdditionalProperties = $null


$keyCredentials += $newKey

Update-MgServicePrincipal -ServicePrincipalId $servicePrincipalId -KeyCredentials $keyCredentials

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,595 questions
{count} votes