Changing token lifetime policy

Hi,

I’m trying to change the “token lifetime policy” in Azure via PowerShell, but it doesnt seem to work. I’ve
search through google for different ideas and syntaxes and nothing seems to work

This is what i have so far;

Authenticate ad global admin user for tenant

connect-AzureAD -Confirm

Create Access policy with token lifetime set to 12hrs

$policy = New-AzureADPolicy -Definition @(’{“TokenLifetimePolicy”:{“Version”:1,“AccessTokenLifetime”:“12:00:00”}}’) -DisplayName “P4AccessPolicy” -IsOrganizationDefault $false -Type “TokenLifetimePolicy”

Verify policy has been created

get-azureadpolicy

List AzureAD linked applications, Public14 should be listed, make a note of the the ObjectId

get-azureadapplication

Assign the newly created policy to the Public14 application using the App Object ID & Policy ID

Add-AzureADApplicationPolicy -Id -RefObjectId $policy.id

Verify the Policy has been applied - this should report an Odatatype of “microsoft.graph.application”

Get-AzureADPolicyAppliedObject -Id $policy.id

If anyone could help that would be amazing

Thank you all

That is a very specific Azure question and with no errors it’s going to be difficult to assist if it is not simply not being set. Recommend that you look in Azure forums and if you cannot find the answer start a thread there:

Search - 9 results found - Microsoft Q&A