The authresult is empty without any exceptions when ran using a task scheduler
- works fine when run manually from powershell
- Fails in manual/scheduled on Task manager
- Run as with dedicated service account with local admin rights, run as batch user rights
- Uses a UPN which has Intune admin rights
- Script works great when running in powershell but fails to get response for auth result when called with " Start-Process powershell.exe -argumentList "-executionPolicy Bypass -File "
Anyone started noticing this recently? Appreciate any pointers
$authResult = [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContextIntegratedAuthExtensions]::AcquireTokenAsync($authContext, $resourceAppIdURI, $clientid, $userCredentials)