Last active
June 26, 2020 13:41
-
-
Save mirontoli/ac7b88df9a28ff4f2e12ad2e56a79f1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tenant = "takana17" | |
Connect-PnPOnline https://$tenant.sharepoint.com/ -SPOManagementShell -ClearTokenCache | |
$realm = Get-PnPAuthenticationRealm | |
$loginName = "c:0-.f|rolemanager|spo-grid-all-users/$realm" | |
$group = Get-PnPGroup -AssociatedVisitorGroup | |
Add-PnPUserToGroup -LoginName $loginName -Identity $group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets up a SharePoint Home Site at Skanska | |
$tenant = "takana17" | |
Connect-SPOService https://$tenant-admin.sharepoint.com | |
$baseUrl = "https://$tenant.sharepoint.com" | |
# site swap takes 1-2 minutes. be patient | |
# https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/invoke-spositeswap?view=sharepoint-ps | |
Invoke-SPOSiteSwap -SourceUrl "$baseUrl/sites/futurehomesite" -TargetUrl "$baseUrl" -ArchiveUrl "$baseUrl/sites/oldroot-deleteit" | |
# Home Site. Docs: https://aka.ms/homesites, it make take some time | |
Set-SPOHomeSite -HomeSiteUrl $baseUrl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment