Get-MsolPasswordPolicy : Access Denied. You do not have permissions to call this cmdlet.

Uday Shankar 25 Reputation points
2023-10-19T11:50:09.7666667+00:00

Hi Team,

I need set Azure AD B2C user password policy validityPeriod. While I am try to get password policy details.

Get-MsolPasswordPolicy : Access Denied. You do not have permissions to call this cmdlet.
At line:1 char:2
+  Get-MsolPasswordPolicy
+  ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Get-MsolPasswordPolicy], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.AccessDeniedException,Microsoft.Online.Administration.Automation.GetPasswordPolicy

Thanks

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
{count} vote

2 answers

Sort by: Most helpful
  1. Andy David - MVP 157.8K Reputation points
    2023-10-19T12:00:39.8233333+00:00
    0 comments No comments

  2. Miftaul Mannan 0 Reputation points
    2023-10-20T03:39:29.2266667+00:00

    You have to create a local account (with Global Administrator role) in the Azure B2C Tenant you're trying to run this command for. Then Connect-MsolService and login with the new account you created.

    0 comments No comments

Your answer

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