Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $pubWeb.Navigation.OrderingMethod = "Automatic"
- $pubWeb.Navigation.AutomaticSortingMethod = "Title"
- $pubWeb.Navigation.SortAscending = $true
- $webURL = "https://censored.sharepoint.com/sites/censored"
- $userName = Read-Host -Prompt "Please enter your username"
- $members = "i:0#.f|membership|censored@censored.com"
- $password = Read-Host "Please enter the password for $($userName)" -AsSecureString
- $SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)
- $context = New-Object Microsoft.SharePoint.Client.ClientContext($webURL)
- $context.credentials = $SPOCredentials
- $web = $context.web
- $context.load($web)
- Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.dll")
- Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Runtime.dll")
- Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Taxonomy.dll")
- Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Publishing.dll")
- $navigationSettings = New-Object Microsoft.SharePoint.Client.Publishing.Navigation.WebNavigationSettings $context, $context.Web
- $pubWeb = [Microsoft.SharePoint.Client.Publishing.PublishingWeb]::GetPublishingWeb($context, $context.Web)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement