Browse Tag

Delve

Removing Permissions for Viewing Modern Personal Blogs in Office 365

A personal blog can be a great tool for you to contribute your thoughts and ideas. Office 365 provides the capability for everyone to have a personal blog that can be accessed via your profile page. 

When you create a new blog post this will be automatically be view-able by all employees. If you do not want to have this capability or manage this in any way it can be done via PowerShell. The example I put together will remove viewers access from all existing blogs so they can only be seen by the owner.

To get started we need a high level understanding of what these blogs are and how they work. I won’t go into all of the details of this because Benjamin Niaulin has already put it together in this great post:

The highlights to support this post are:

  • When a user follows the links to create a new blog post a new site collection is built with the managed path of /portals/personal with a site name of your user account
    • i.e. tenant.sharepoint.com/portals/personal/dmadelung
    • These are not viewable in any SP Admin center and Get-SPOSite will not work
  • Site collections are only built after a user initiates the creation so not all users will have one
  • Blog posts (stories) are creates at pages in the pages library on your site collection
  • Permissions are handled with SharePoint permissions and inherited down with a Contributors, Creators, and Viewers SharePoint Group
    • The viewers group includes “Everyone except external users” by default
  • The blogs are NOT deleted when a user leaves like their OneDrive site collection

And here are details the details from Microsoft around personal blog posts in Office 365:

Removing existing permissions via PowerShell

As this is all hosted in SharePoint there could be multiple ways that we can control these. Unfortunately I couldn’t find a way to control things as scale but there is a small UserVoice submission for it. What I wanted to ensure was that creators could still get to their content but no one else could view anything. The path I took to manage these was through PowerShell and CSOM (Client Side Object Model)

Here is link to the GitHub repo and I will break it down below along with the script.

Here are some key things to note:

  • I can not confirm that doing this is the best practice but it was the easiest way I found to control these without a any administrator controls available to us. 
  • This is currently built to run on demand but could be updated to run on a schedule via something like Azure Automation.
    • To catch everything it will need to run on a schedule because any future sites will not be caught.
  • This could be updated to be used as a reporting tool or identification tool for cleanup.
  • I would comment out the actual removal of the permissions and put some logging in to test before fully running.
    • Also if you have any changes please update the repo!
  • This queries the user profile service in SharePoint Online to get the full list of users which could be huge.
    • I didn’t test this on a very large environment so this could take awhile to run or need to be enhanced for scale.
  • All of the user profile gathering was copied from this post from Microsoft on how to display a list of OneDrive for Business site collections

To get started with CSOM & PowerShell with SharePoint Online here is a good blog post from Chris O’Brien. You can get the latest version of SharePoint Online CSOM here. If you download the nuget file you can change the file extension to .zip and extract the .dlls.

To utilize the script make sure you fill out the appropriate variables and more information about what this will do is below the script. Make sure you test any script you get online before you really run it!

The end result will be that all existing blog sites will have anyone in the Viewers SharePoint Group removed

Before…

After..

Steps to hide content from Delve in Office 365

When Delve was released by Microsoft it was pretty groundbreaking in the content management world. There was finally a tool that would help people find content no matter where it was located. This is one of the primary struggles that I work with clients with all the time. People love to think that adding custom managed metadata and building a super complex information architecture will allow people to find content easier. In some use cases this works but as a daily business practice this can drive people away. And once you break down those ECM walls you end up with unorganized chaos. As an ECM guy my palms get sweaty just thinking about some of the setups I have worked on where millions of files are strewn across file shares with no good way to ever find anything. So when Delve came along and basically said; “I don’t care where your content is – here are the files that I think you should be using.” this lessened the need of an in-depth ECM process and at the same time opened up people’s eyes around content security. I don’t want to go too much into Delve as a whole but here is some quick info and handy links before I break down how to hide content.

What is Office Delve?

  • Delve helps you discover the information that’s likely to be most interesting to you right now – across Office 365. Find information about people – and through people – and help others find you.
  • You don’t have to remember the title of a document or where it’s stored. Delve shows you documents no matter where they’re stored in OneDrive for Business or in Sites in Office 365.
  • Delve never changes any permissions, so you’ll only see documents that you already have access to. Other people will not see your private documents.
  • Office Delve for Office 365 admins

Hiding content from Delve

You may have a scenario in which you don’t want content to appear in Delve no matter what. Some examples could be high volume transactional processing files or payroll tracking information. Thankfully Microsoft has given us a simple way to hide content from Delve by using a site column called HideFromDelve. This can be done at the library level as well but I wanted to provide instructions so end users can have the power to add this column after it has been created once.

Important note: This will only hide content from the Delve app itself. The document will still be viewable via search and the Office Graph.

  1. Navigate to the site that has a library of files in which you want to be able to hide them from Delve
  2. Use the gear in the top right to go to Site Settings

  3. Under Web Designer Galleries, click on Site columns

  4. Click Create


  5. Enter the column information and click Ok, the name and type have to be EXACT for this to work.
    1. Name: HideFromDelve
    2. Type: Yes/No (checkbox)
    3. Default value: No


  6. Navigate to the library that you want to hide content and go to Library Settings via the ribbon


  7. Under the list of columns, click the link Add from existing site columns

  8. Scrolls down in the Available site columns list and select the newly created HideFromDelve column and click the add button to move it across. Then click Ok

  9. Navigate back to your library and you can begin marking documents to be hidden from Delve. The quickest way to do this is through the Quick Edit view.

  10. After the next scheduled crawl, the document will no longer appear in Delve!