Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. $pubWeb.Navigation.OrderingMethod = "Automatic"
  2. $pubWeb.Navigation.AutomaticSortingMethod = "Title"
  3. $pubWeb.Navigation.SortAscending = $true
  4.  
  5. $webURL = "https://censored.sharepoint.com/sites/censored"
  6. $userName = Read-Host -Prompt "Please enter your username"
  7. $members = "i:0#.f|membership|censored@censored.com"
  8. $password = Read-Host "Please enter the password for $($userName)" -AsSecureString
  9. $SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)
  10.  
  11. $context = New-Object Microsoft.SharePoint.Client.ClientContext($webURL)
  12. $context.credentials = $SPOCredentials
  13. $web = $context.web
  14. $context.load($web)
  15.  
  16. Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.dll")
  17. Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Runtime.dll")
  18. Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Taxonomy.dll")
  19. Add-Type -Path (Resolve-Path "C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Publishing.dll")
  20.  
  21. $navigationSettings = New-Object Microsoft.SharePoint.Client.Publishing.Navigation.WebNavigationSettings $context, $context.Web
  22. $pubWeb = [Microsoft.SharePoint.Client.Publishing.PublishingWeb]::GetPublishingWeb($context, $context.Web)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement