-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intune-backup-restore-withgui | Token Expires #47
Comments
Hi, It might be easier to expand the token expiry time https://learn.microsoft.com/en-us/entra/identity-platform/configure-token-lifetimes |
Hi, That will be indeed the easiest solution. |
You could try adding some additional connections in the script, but I don't know how well that would work. Or maybe a disconnect and reconnect? |
I was thinking to add some extra code in the function 'Connect-ToGraph', something like: And then at some places (or make a extra function) to check if the token is still valid, something like: `try {
} I will find a solution, because the script is nice! 👍 |
That should work ok. If you do get it working, I can add it to the main script |
I'm going to try this tomorrow. |
I have implemented the code to check the expiration of the token. So far, it works. I made a pull request. I hope I did it correct. :-) |
That was quick! I've merged the request, code signed it and updated the PSGallery version as well |
Thank you for merging the code. And great to hear you also have updated the PSGallery version. 👍 |
I have reorganized the script. I also found a little error in the rename part. To this:
But, I still can not get the rename to work. :-), maybe I 'm doing something wrong. Do you want me to sent a pull request? |
I can sort that bit without a pull request :) How are you triggering the rename? |
I trigger it like this: |
Is type set to backup? The rename happens when backing up, not when restoring |
I tried both, but it is not a very big deal. :-) |
Hi,
I like you're 'intune-backup-restore-withgui' script and want to use it for our environment.
I have tested the script and now I'm trying to back-up everything.
I make use of a app registration with the needed permissions.
Sadly, the backup runs more then one hour and after one hour the backup is failing because of the token that has expired.
{"error":{"code":"InvalidAuthenticationToken","message":"Lifetime validation failed, the token is expired.
Is it possible to make some checks in the script so the token gets renewed, lets say 5 minutes before it gets expired?
The text was updated successfully, but these errors were encountered: