Trusted IP's in Multifactor Authentication Settings via Graph API or Powershell?

Kaden Kelsey 1 Reputation point
2021-01-10T23:13:29.837+00:00

Hi,

Is there a way to add trusted IP's into the Multifactor Authentication Settings via Graph API or Powershell?

Thank you for your time!

55671-capture.png

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,351 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,363 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VipulSparsh-MSFT 16,231 Reputation points Microsoft Employee
    2021-01-11T03:15:44.537+00:00

    @Kaden Kelsey Thanks for reaching out.
    You can use Graph API for adding trusted IP for MFA, follow the guide here.

    This will help you create a IPnameslocation :

    POST https://graph.microsoft.com/beta/identity/conditionalAccess/namedLocations
    Content-type: application/json

    {
    "@odata.type": "#microsoft.graph.ipNamedLocation",
    "displayName": "Untrusted IP named location",
    "isTrusted": false,
    "ipRanges": [
    {
    "@odata.type": "#microsoft.graph.iPv4CidrRange",
    "cidrAddress": "12.34.221.11/22"
    },
    {
    "@odata.type": "#microsoft.graph.iPv6CidrRange",
    "cidrAddress": "2001:0:9d38:90d6:0:0:0:0/63"
    }
    ]
    }

    Check this page for more information.

    -----------------------------------------------------------------------------------------------------------------

    If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community.