Open skghq opened 9 months ago
I re-ran O365Group using -Verbose
. It is hanging up when the access token expires.
VERBOSE: Dependencies were already successfully validated. VERBOSE: Credential was specified. Connecting via User Principal VERBOSE: Dependencies were already successfully validated. Get-MgGroup : Your access token has expired. Please renew it before submitting the request. Status: 401 (Unauthorized) ErrorCode: Authentication_ExpiredToken Date: 2023-11-25T12:18:52 Headers:
Stack trace: At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1122.1\DSCResources\MSFT_O365Group\MSFT_O365Group.psm1:79 char:9
+ CategoryInfo : InvalidOperation: ({ ConsistencyLe...ndProperty = }:<>f__AnonymousType84`9)
[Get-MgGroup_List], Exception
+ FullyQualifiedErrorId : Authentication_ExpiredToken,Microsoft.Graph.PowerShell.Cmdlets.GetMgGroup_List
This is a duplicate of: https://github.com/microsoft/Microsoft365DSC/issues/3531
I closed the original issue as it coincidentally ran successfully once. This ticket has more detail so I did not reopen the old ticket.
Thanks for reporting. We've seen this issue with application based authentications before. It's new for Credential based authentication. It looks like we can extend the previous fix for this scenario.
Linking #2915 for tracking.
@andikrueger : do you know if this has been fixed for O365Group using application based authentication? I would like to start backing up this resource. I can switch authentication method if needed.
Description of the issue
Command:
Export-M365DSCConfiguration -Components @("O365Group") -Credential $Credential -Path $FilePath -FileName $FileName
The first time I ran this was with v1.23.1115.1 and it hung up on exporting [968/3409].
The second time I ran this was with v1.23.1122.1 and it hung up on exporting [894/3411].
I'm re-running this with
-Verbose -Debug
to see if I can catch it hanging up again.Many other exports take 3-4+ hours to run and have always completed. O365Group is the only one to hang up, so far, and it has done it twice.
I have also received other errors with O365Group. I have not went through the logs enough to determine if it only impacts this module. Screenshot attached of a third run (v1.23.1115.1.) That export did eventually complete at 19328 seconds (~5.3 hours)
Microsoft 365 DSC Version
1.23.1122.1
Which workloads are affected
Office 365 Admin
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version