Skip to content

Instantly share code, notes, and snippets.

Last active Jun 26, 2020
What would you like to do?
$tenant = "takana17"
Connect-PnPOnline https://$ -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
# Sets up a SharePoint Home Site at Skanska
$tenant = "takana17"
Connect-SPOService https://$
$baseUrl = "https://$"
# site swap takes 1-2 minutes. be patient
Invoke-SPOSiteSwap -SourceUrl "$baseUrl/sites/futurehomesite" -TargetUrl "$baseUrl" -ArchiveUrl "$baseUrl/sites/oldroot-deleteit"
# Home Site. Docs:, 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