This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
Replies: 1 comment
-
So, I've spent some more time working with this and it seems that if I add even more time between the login and actual code execution things are finally working. My delays are on the order of 2 minutes now. Kind of ridiculous but it works now. Still would be nice to figure out how to enter the credentials and 2FA once for both logins. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I am new I apologize in advance for any obvious questions. I am writing a powershell script to manipulate the sharepoint side of teams sites. My development is with PowerShell ISE. An overview of the script is below (quotes show exact command used):
I assign variables
" Connect-Microsoft Teams " (This prompts for creds and 2FA)
I create the team, get the group ID and remove WIKI (although this part doesn't work yet... lol)
" Connect-PnPOnline -ClearTokenCache -SPOManagementShell $SharePointSiteName " (This prompts for creds and 2FA)
I kill inherited rights, remove user and visitor rights then build my custom folder/rights structure.
Everything works when I execute it is sections from the ISE using F8. If I try and run the entire script it always seems to fail after the PnP login and acts like it isn't logged in yet. I just don't get what's different. I've tried timings to make sure the Team sharepoint site has been created but it still fails consistently. Also if possible I'd love to be able to enter the credentials/2FA only once so the end user doesn't have to do this twice.
Beta Was this translation helpful? Give feedback.
All reactions