powershell
powershell copied to clipboard
[BUG] Get-PnPMicrosoft365Group -IncludeSiteUrl -IncludeOwners errors due to token expiration on tenants with 4K+ M365 Groups
Reporting an Issue or Missing Feature
Due to the access token being passed in as a string to the Microsoft365GroupsUtility.GetGroupsAsync function, on large tenants the operation can take several minutes to complete, sometimes exceeding the expiration time of the provided (stale?) access token.
Get-PnPMicrosoft365Group -IncludeSiteUrl -IncludeOwners
Expected behavior
The cmdlet will automatically refresh any expired access tokens and allow the operation to succeeded. I potential short term option would be to force a token refresh before passing it over to Microsoft365GroupsUtility.GetGroupsAsync, allowing a much longer period of time before token expiration.
What is the version of the Cmdlet module you are running?
1.12.0
Which operating system/environment are you running PnP PowerShell on?
- [x] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify