Browse Tag

sharepoint

Get-SPOSite Now Returns Office 365 Group and Video Site Collections

For the longest time it was not possible to see Office 365 Group and Office 365 Video site collections in PowerShell using the SharePoint Online Management Shell and the Get-SPOSite cmdlet.  If you declared the site directly you could see the site.  Also if you used the Set-SPOSite cmdlet to set values of the site it would work but you couldn’t see all sites with one cmdlet.  As of a recent release this is now possible. 

Get-SPOSite

You can also now use a -Template command to limit the query based on the site collection template which will allow you to get only Office 365 Video or Group site collections

Get all Office 365 Group site collections

Get-SPOSite -Template GROUP#0

Get all Office 365 Video site collections

Get-SPOSite -Template POINTPUBLISHINGTOPIC#0

Locking a SharePoint Online Site Collection

Within SharePoint Online you have the ability to completely lock down a site collection so no one can get access to it.  This is set via PowerShell and the SharePoint Online Management Shell.  Here are instructions on how to get started using connecting to SharePoint Online via PowerShell.  This lock can also be set on a user’s OneDrive for Business site collection.

Along with the ability to lock a site collection you can also set a redirect URL for the tenant for any locked sites that are accessed.  That means that when a user tries to access that locked site they will be redirected to the URL that you provided at the tenant level.  This could be helpful to provide instructions or further info for anyone letting them know that the site they were trying to access has been locked.  If no redirect URL is set they will receive a 403 error. 

NOTE: As of writing this post you are not able to set a lock state of a site provisioned with an Office 365 Group even though the PS cmdlets say it should be possible.  I will demo the actions later in this post but I have contacted Microsoft on this error and they state it is currently as designed and the error received is incorrect. 

The PowerShell cmdlets that are used to set this up are:


Steps to lock or unlock a site collection

1 – Connect to SharePoint Online

Connect-SPOService

2 – Locking – Set the -LockState of the site collection to “NoAccess” while replacing the domain and sitecollection info to lock the site

  • This can also be a OneDrive for Business site collection (i.e. https://domain-my.sharepoint.com/personal/usersite)
Set-SPOSite -Identity https://domain.sharepoint.com/sites/sitecollection -LockState "NoAccess"

 

2(a) – Unlocking – Set the -LockState of the site collection to “Unlock” while replacing the domain and sitecollection info to unlock the site

Set-SPOSite -Identity https://domain.sharepoint.com/sites/sitecollection -LockState "Unlock"

3 – Navigate to the URL to confirm and use PowerShell to confirm locked state

Get-SPOSite -Identity https://domain.sharepoint.com/sites/sitecollection | select Title,URL,LockState


Steps to set a tenant redirect URL

1 – Connect to SharePoint Online

Connect-SPOService

2 – Set the NoAccessRedirectURL of the tenant to a URL while replacing the domain and sitecollection info

Set-SPOTenant -NoAccessRedirectUrl "https://domain.sharepoint.com/Pages/Locked-Site.aspx"

3 – Navigate to the URL to confirm the redirect.  This may take a few minutes

To remove the NoAccessRedirectURL you can pass in an empty string

Set-SPOTenant -NoAccessRedirectUrl ""

Trying to lock an Office 365 Group site

Here is the error you receive when trying to lock a group site:

 

Set-SPOSite : https://domain.sharepoint.com/sites/drewtesto365group is a OneDrive for Business site collection. The only valid parameters for this type of site collection are ‘-Identity’, ‘-StorageQuota’, ‘-StorageWarningLevel’, ‘-LockState’ and ‘-SharingCapability’.
At line:1 char:1
+ Set-SPOSite -Identity https://domain.sharepoint.com/sites/dre …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSite

The error declares it as a OneDrive for Business site collection and says that -LockState is a valid parameter yet still doesn’t work.  I opened a support ticket with Microsoft and this was their resolution:

“It is by design Issue. We can lock a site collection however we cannot lock a unified group site.”

If this is something that you need I would recommend adding to to Uservoice.  If you need to “lock” an Office 365 Group site the best way as it exists when I am writing this is to remove permissions within the group.


Getting status of all locked site collections in a tenant

Get-SPOSite | Where-Object {$_.LockState -eq "NoAccess"}

At this point Get-SPOSite will not return any OneDrive for Business or Group sites.  There is new parameter called “-IncludePersonalSite” which at some point should return OneDrive sites via this cmdlet.  If you run this now you get the error:

WARNING: SharePoint Online does not support these new features yet.

Get-SPOSite -IncludePersonalSite $true | Where-Object {$_.LockState -eq "NoAccess"}

 

Ignite 2016 Info and Thoughts on Announcements for SharePoint – OneDrive – Office 365

2016-09-28-14_49_22-ignite-sharepoint-onedrive-office-365-info

I put together a Microsoft Sway through my Concurrency tenant that wraps up all of the announcements and my thoughts from the collaboration space at Ignite 2016.  This includes info on everything I was able to attend and intake while here in Atlanta.  I used Microsoft Sway so I could continuously update the Sway throughout the conference and after the conference for future review.  My changes are made in real-time and it’s super easy to update.

Link to Sway

SharePoint Designer – Error: Could not save the list changes to the server

I was working with a client recently and tried to create a new form for a list within SharePoint Designer and received the unfriendly error:

Could not save the list changes to the server.

2016-09-22-14_27_48-https___partners-jci-com_sites_20163221517880_itimo

I had created list forms on this list before, so I began back tracking what has changed since I had created one on this list before.  One thing I did was change a set of Lookup columns within the list to point to new lists and removed the old lists where lookup columns used to point to.

When looking at the list columns I found the lookup column that didn’t have a list that it pointed to:

2016-09-22-14_31_28-start

When you go into the column you will see again there is no corresponding list for the lookup:

2016-09-22-14_31_53-change-column-internet-explorer

I deleted the old column and REFRESHED SharePoint Designer.  If you just try to create the form without refreshing you will receive the same error.

2016-09-22-14_41_20-microsoft-edge

Once I refreshed…Voila!

2016-09-22-14_38_56-https___partners-jci-com_sites_20163221517880_itimo

Hopefully if anyone else gets this error this post will be helpful!

 

Changing a site column or content type group to the _Hidden group

Content types and columns use Groups to organize them. These are used so things are easier to find as there are a lot of default columns and content types (600+ columns and 80+ content types). As you turn on more features you will continue to get other content types and columns added to your site for you to use. You can access the site column and site content type through the Site Settings page.

2016-08-16 13_23_11-Jump List for Mozilla Firefox


Once you go into either page you will see the information organized by Groups with a Show Groups drop down on the top right of the page to easily filter.

2016-08-16 13_25_25-Photos


What you WON’T see on either of these pages are a collection hidden content types and columns.  A good example is the overall Title column for the Item content type. This is a very crucial column that is used across many site content types. So if you change the Title column at the site level, it will cascade to all of your content types and lists that are using that column. I have worked with many clients that did not fully understand what they were updating when they did this so it’s fairly common to see a field like this renamed. If you go into the site columns page you will not see this column because it is part of the _Hidden group. If I go in through site content types -> Item -> Title column, you will see that the column exists in the _Hidden group.

2016-08-16 13_31_41-Start


To change the group of this column you can either select an existing group or create a new group.

2016-08-16 13_34_36-Start


Once you make your changes the column or content type that you changed will now be viewable under the site columns or site content types page in the group that you selected.

2016-08-16 13_36_55-Photos


Now what if you wanted to change this back or add a new column or content type to the _Hidden group? When you go back to the edit page you will see that under the Existing group drop down you don’t have the _Hidden option.

2016-08-16 13_38_29-Start


All you need to do is type “_Hidden” in the New group text box and it will move it into the _Hidden group and it will NOT create a new group.

2016-08-16 13_39_49-Start


Now when you go back to the site columns or site content types page you will no longer see what you moved to the _Hidden group.

2016-08-16 13_41_19-Photos