How to set Azure lockout policy settings using Graph apis?

Sagar Dey 0 Reputation points
2023-03-23T15:00:22.35+00:00

Hi, I am looking for a way to set the lockout policy settings in Azure using Powershell (preferably Microsoft Graph API or azure cli). The specific settings I want to export with Powershell are 'Lockout threshold' and 'Lockout duration in seconds' that can be found in the Azure portal at Home > Security > Authentication Methods > Password Protection.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,646 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,081 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,562 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,951 Reputation points
    2023-03-24T11:33:59.7333333+00:00

    Hello there,

    This can be queried using Microsoft Graph PowerShell with beta profile. Please find the commands and sample out below:

    Connect-MgGraph

    Select-MgProfile -Name beta

    Get-MgDirectorySetting

    Get-MgDirectorySetting -DirectorySettingId 08e0dc4c-39f0-410a-9921-ded2eaa07136 | Select-Object -ExpandProperty Values

    Similar discussion here https://learn.microsoft.com/en-us/answers/questions/1178759/how-to-get-azure-lockout-policy-settings-using-pow

    Protect user accounts from attacks with Azure Active Directory smart lockout https://learn.microsoft.com/en-us/azure/active-directory/authentication/howto-password-smart-lockout

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments