Getting error while creating new AzureADPolicy

Imtiyaz Ali 1 Reputation point
2020-04-08T15:37:58.213+00:00

I am not able to created new AzureADPolicy and getting below error.

Script which I am using

New-AzureADPolicy -Definition @('{"TokenLifetimePolicy":{"Version":1,"AccessTokenLifetime":"23:59:59","MaxAgeSessionSingleFactor":"23:59:59"}}') -DisplayName "WebPolicyScenario" -IsOrganizationDefault $false -Type "TokenLifetimePolicy"

Error which I am getting

7214-error.jpg

Can anyone help if I am missing anything?

Below powershell module installed on my machine...

ModuleType Version Name ExportedCommands



Binary 2.0.2.5 AzureADPreview {Add-AzureADAdministrativeUnitMember, Add-AzureADApplicationOwner, Add-AzureADApplicati...

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,388 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 94,911 Reputation points MVP
    2020-04-08T16:44:00.727+00:00

    Judging by the other thread and the same error I'm getting, I'd say this is an issue on the backend. Do note however that the token lifetime policies will be deprecated, and going forward you should use the session control functionality instead: https://learn.microsoft.com/en-us/azure/active-directory/conditional-access/howto-conditional-access-session-lifetime#configuring-authentication-session-controls

    0 comments No comments

  2. Anuj Rana 211 Reputation points
    2020-04-09T04:56:59.003+00:00

    You need to update your module to 2.0.2.85. Previous modules are no longer supported for policy creation.

    You can update the same from : https://t.co/kPilxDKnMQ?amp=1

    Please confirm if this fixes your issue. I have tested new policy using the parameters you have shared and it is working as expected on 2.0.2.85.

    7272-policy.png

    0 comments No comments