Aug 13 2021 06:12 AM
Hello.
I'm trying to make a Powershell script which gathers all of our Microsoft Groups and then go through each of them searching for specific file- & folder content.
With SharePointPnPPowerShellOnline I could pass in a Credential object and re-use that to first connect to the tenant and then later to each site using the -Credential parameter.
With PnP.Powershell (the new crossplatform version) I can't figure out how to re-use my authentication.
First I connect to the tenant and then I have to connect again to each site (Microsoft Group). By doing this I get more than one credential request.
I use the recommended way of connecting: Connect-PnPOnline -Url $Url -Interactive
Get the sites with: Get-PnPTenantSite
And then for each site I'm trying: Connect-PnPOnline -Url $Site -Interactive
Is there someway I can re-use my authentication ?
NB! I'm using MFA on my account.
Aug 16 2021 05:01 AM
SolutionAug 16 2021 05:01 AM
Solution