Category Archives: SharePoint 2016

Connect-PnPOnline: unwanted credential caching

UPDATE: May 2021

This problem, as described in my original post below, has been fixed for the Connnect-PnPOnline, when using the UseWebLogin param. Plus, the ClearTokenCache parameter is no longer available…

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -UseWebLogin; 

The “new” (or orignal) experience when calling the above Cmdlet will look like the following screen shot:

Login screen: That didn’t work … Here are a few ideas…

For more options, see https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-9

An alternative is to use the Interactive prameter:

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -Interactive; 

For more information, see https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-10

Original Post

Since creating a new Windows 10 profile (new PC) the Connect-PnPOnline PowerShell CmdLet has been caching my primary credentials while using the UseWebLogin parameter.

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -UseWebLogin; 

This wouldn’t be a problem if I only worked with on tenant…

After a fair amount of Google searching, mucking around with Internet Explorer and Microsoft Edge settings I found that running the Connect-PnPOnline CmdLet with the following parameters worked:

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -SPOManagementShell -ClearTokenCache;

Once signed you can revert back to using the UseWebLogin parameter, well until the next time the PowerShell console caches the wrong details… 😉

For more information see: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/connect-pnponline?view=sharepoint-ps

SharePoint ‘Site Content and Structure’ Admin Page

There have been numerous time I’ve need to publish multiple documents in one go. You could use PowerShell or better still the UI…

Welcome to the Site Content and Structure administration page:
https://[TENANT].sharepoint.com/<SITE-PATH>/_layouts/15/sitemanager.aspx

The Site Content and Structure has been around since SharePoint 2007 and it really shows. But don’t let that get in the way of useful functionality. It is still available in SharePoint Online, even though the link has been removed from the Site Settings page.

Imagine you need to publish 50 site pages in one go:

  1. Navigate to the Site Content and Structure using the URL above
  2. Click on Site Pages, within the left navigation
  3. Select the pages to publish
  4. Click on the Actions menu and then Publish

You will see there are other options:

  • Copy…
  • Move…
  • Delete
  • Check Out
  • Discard Check Out
  • Check In
  • Publish
  • Unpublish this version

Perhaps Microsoft will revive the Site Content and Structure and give it the modern face-lift it deserves…? Vote here if you feel the same: https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/37335316-bring-back-the-site-content-and-structure-page