Configure ADFS with Azure MFA

Sunil Saini 0 Reputation points
2024-06-14T11:13:57.4+00:00

while trying to configure ADFS with Azure MFA need to RUN the below script . following the below page
https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/operations/configure-ad-fs-and-azure-mfa

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 Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.