question

ImtiyazAli-4066 avatar image
0 Votes"
ImtiyazAli-4066 asked AnujRana-1707 answered

Getting error while creating new AzureADPolicy

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...


azure-active-directory
error.jpg (61.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

michev avatar image
0 Votes"
michev answered

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://docs.microsoft.com/en-us/azure/active-directory/conditional-access/howto-conditional-access-session-lifetime#configuring-authentication-session-controls

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AnujRana-1707 avatar image
0 Votes"
AnujRana-1707 answered

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



policy.png (17.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.