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