My SharePoint Log

Orphaned SharePoint Online Site Collections after an O365 Group

itsbrooken

O365 Groups or Unified Groups is a cool O365 feature, except when it don’t work as expected.

You just deleted the Group, but the hidden SharePoint Online Site Collection connected to the group didn’t got deleted automatically with the group.

Guess what it’s now an orphaned site collection in locked state.

To Remove these sites, follow the script below:

 

##Connect to SPO

Connect-SPOService -Url https://tenant-admin.sharepoint.com

#Get all SPO Sites | find your orphaned O365 Group Site Collection
Get-SPOSite

#The SPO site Collection is actually locked, unlock it
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/site -LockState Unlock

#If you were not Site Collection Admin before the O365 Group was deleted
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/site -owner tenant-admin@yourdomain.com

#Then remove the orphaned site
Remove-SPOSite -Identity https://tenant.sharepoint.com/sites/sites -NoWait

 

FIX THIS MICROSOFT!!

SharePoint 101 – Image Column in SharePoint list view

SharePoint list is a really powerfull tool, now and then we want it to do even more.

Example:

  • I want the list the have a picture column
  • This column is should contain a link to a picture
  • But I don’t want the picture to be shown in full size as it will “destroys” the list view
  • I don’t want to use code or workflow or css/javascript fix

I want something like this:

imagecolumn001

Step by step:

  1. Create you list, then you will need a column of type “Hyperlink or Picture”| choose format url as “Picture”
  2. Create a standard SharePoint picture library
  3. Go to Site Settings | Image Renditions | If you don’t see it, turn on publishing featureimagecolumn002
  4. Create a rendition of your choiceimagecolumn003
  5. Then navigate to your Picture library and upload your image, when you select the image, in the ribbon you will se Design | Edit Rendition | Click “Edit Renditions”. This will give you the full link of available renditions og the selected image
    imagecolumn004imagecolumn005
  6. Copy the URL and paste it in the Picture Column and you’re doneimagecolumn006

SharePoint 101 Limited-Access User Permission Feature – PAIN!

Everybody ever working with SharePoint Permission know for a fact that is a real PAIN!!

I recently experienced how pain-full it can be sometimes.

Background:

We have a solution with some nice SharePoint sites | some of the sites have broken inheritance down in the hierarki, and everything has been working great.

Last week i received a request saying that users that’s supposed to have access can no longer access the content. My first thought was that someone has been “handy” with the permissions, turns out everything was fine except that uses don’t have access any more.

Turned to our “best friend G” for help and found this article hidden deep down on page 5

https://support.microsoft.com/en-us/kb/3039997

It turns out our problems was because of this:

When you share a folder with a user who can’t access the parent folder or site, SharePoint assigns the user limited access to the parent items. Specifically, SharePoint lets the user access the folder without obtaining permission to access the parent folder and other items (other than limited access). However, after Limited-access user permission lockdown mode is enabled, the user doesn’t have access to the folder because the necessary limited access permission on other items no longer works correctly.

This feature was turned on during last weeks deployment schedule, but no one knows this will break the custom inheritance before it happened.

We turned it OFF as we don’t need it, and peace is returned to my SharePoint Universe.

SharePoint 101 Auto Create Documents based on SharePoint Designer Workflow

It’s been a while since I’ve built something with SharePoint Designer Workflow, I kinda missed it. 🙂

An opportunity showed up, when i received a business request to automatically create documents based on a SharePoint list item. This post will describe the steps needed to make this work without custom development.

Business requirements:

  • A list item describing a meeting agenda
  • Automatically creates a new meeting documents based on the list item
  • The Document should have text prefilled out
  • If the meeting agenda is updated so should the document
  • If the meeting is confidential, the documents should be accessed only by site owners

Main Goal:

  • An overview of all upcommming meetings and their agendas
  • Automate the creation of meeting documents

End solution:

The solution for this is built with standard SharePoint List and 3 SharePoint Designer Workflows

  • One Custom List | containing meetings agenda and relevant data fields.
  • One custom document content type “Meeting Agenda” with the document template
  • One Document library | containing “Document Set” and custom word Content Type
  • The meeting content type will contain “Smart parts”
  • One Workflow for creating the document set and the meeting document
  • One Workflow for updating the document set
  • One Worfklow with impersonation for setting permissions

Preparations:

Before creating the workflows we need to create the custom lists we’ll need, enable the content types we need, then make changes to our word template file:

In SharePoint create a custom list named “Meeting Agenda”, with relevant fields, this is my sample:

workflow001

In SharePoint create a new content type “Meeting Agenda” | upload your document template

workflow002

In SharePoint create a new document library “Meeting Documents” | enable “Management of Content Types” then add “Document Set” and “Meeting Agenda” to the library.

workflow003

Add the custom colums you will use in the “Meeting Agenda” to the library, beware that this can also be created as site columns ect.

These columns will be added to the “Document Set” | and configured to inheritance | remember the “MeetingID” column we will use it to update list items.

workflow004

workflow005

In the advanced settings for the “Meeting Agenda” content type edit the word template

workflow006

Using “Quick Parts | Document Property” connect the columns you need to the tempalate then save the template:

workflow007

Creating workflows

Using SharePoint Designer 2013 login to your site | click workflow | list workflow |

Our first workflow is called “Create meeting doccument” attached to “Meeting Agenda” List

workflow008

SharePoint and SharePoint Designer sometimes encodes text, people pickers and date field differently, I then use Workflow variables to convert the data.

Example, i want the comments in “Plain Text”.

Then use the “Create list item” to create a new document set and Document based on the content types

workflow009

This actions creates the meeting documents | we don’t need to add all the colums as it will be added by the document sets.

workflow010

Create a new list workflow | this workflow will use the action “Update list item” | remember to filter the item using the “MeetingID” from earlier

workflow011

Our last workflow is attached to the “Meeting Document”

We will run a SharePoint 2010 Workflow “Impersonation Step” | Replacing the Document Set item permission with a new one.

workflow012

We will now have 3 Workflows

workflow013

“ChangeItemPermissions” | This workflow should run by creation and every time the document set changes

“Create meeting document” | This workflow should run only once when a new meeting agenda is created

“Update meeting document” | This workflow should run only when the meeting agenda list item is edited

Publish your work and test your solutionworkflow014

workflow015

This is how the “Meeting document” will look like when everything is done

workflow016

 

Happy “SharePoint’ing” | We’re not done with SharePoint Designer yet!!!

 

PS! in case someone wonder why I’m using “Document set”, it’s because some of the meetings sometimes have additional documents that should be included. Using the “Document Set” will allow uses to upload additional files that should be attached to the same meeting.