Browse Tag

sharepoint online

Hide Sync for Sites via PowerShell in SharePoint Online – Offline Client Availablity

Offline Client Availability is built within SharePoint to “Prevent users from downloading content from a site” via MS support.   There is not a way that I am aware of to fully stop existing syncs, but what is capable is to hide the Sync option from the views within the document library.  This setting can be done at the site and the library level.  

When working at the site level, this setting actually exists at the “Web” level within SharePoint.  This means its not a site collection level and needs to be set per site, including all subsites. 


What it looks like when done

This is what you will see with this setting set to NO:

Modern experience (no sync option)

Classic experience (sync option greyed out)


This is what you see with this setting set to YES:

Modern experience

Classic experience


Setting via Browser

The Offline Client Availability option can be set by single site under…

  1. On the site, click Settings > Site Settings.
  2. Under Search, click Search and offline availability.
  3. In the Offline Client Availability section, select No.


 

Setting via PowerShell powershell2

There was a good discussion going on within the MS Tech Community site around the ability to restrict sync via scripting and I tried to put together what I could to support it.  Obviously it would be tedious to try to set that for all sites and subsites across your tenant.  This was my first published attempt for CSOM so I used some great references to get me through it and this is probably rough around the edges.  All feedback is helpful!

Setting this CSOM web property (ExcludeFromOfflineClient) to true does not disable synchronization. Instead, it represents a recommendation to the client not to attempt synchronization via technet.

Ensure that you update the <script path> section near the header with the path to your CSOM files. Ensure you have at least the August 2016 version of CSOM.  Link to latest Nuget for download.

Link to download most recent version of powershell script from TechNet gallery

16235-illustration-of-a-green-download-button-pv


Used helpful references 

So much good info already out there that helped me get started; Thank you!

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

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)

 

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

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


Steps to set a tenant redirect URL

1 – Connect to SharePoint Online

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

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


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

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.

 

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

Adding and Removing Videos from the Office 365 Video Spotlight

The landing page of the Office 365 Video Portal has a top section dedicated to “Spotlight” videos. You can also choose channels to spotlight on the landing page. You can spotlight up to four videos and three channels on the portal home page. You want to use this section to highlight important videos for your organization. All of these videos are maintained manually by users who have the Video admin permission.

2016-05-23 14_29_24-Video

Adding a video to the spotlight is very straightforward but removing it is not as intuitive.

Steps to add a spotlight video

1)  Navigate to your Office 365 Video Portal landing page

2016-04-22 10_34_40-Settings

2)  Click on Portal Settings in the toolbar

2016-04-22 10_37_29-Settings

3)  Click on the Spotlight section in the left navigation

2016-05-23 14_40_32-Video portal settings

4)  Under the Spotlight videos section click on a section you want to add the video to

2016-05-23 14_42_20-Video portal settings

5)  Select the video you want to add and click OK (there may be a delay if you just uploaded the video as it needs to be indexed by search first)

2016-05-23 14_43_54-Video portal settings

6)  Click Save

2016-05-23 14_45_48-Video portal settings

Steps to remove a spotlight video

1)  Navigate to your Office 365 Video Portal landing page

2016-04-22 10_34_40-Settings

2) Click on Portal Settings in the toolbar

2016-04-22 10_37_29-Settings

3)  Click on the Spotlight section in the left navigation

2016-05-23 14_40_32-Video portal settings

4)  Click on the Video you want to remove under the Spotlight videos section

2016-05-23 14_47_47-Video portal settings

5)  DON’T select any video and JUST click OK

2016-05-23 14_48_44-Video portal settings

6)  You will see the spotlight video section is now empty. Click Save and the landing page will be updated.

2016-05-23 14_49_44-Video portal settings

Disabling Office 365 Video

I don’t really want to write this post as I believe everyone who has Office 365 and appropriate licenses for Video should be looking at it, but I have worked with quite a few clients recently and understand the need to control the release of features.  When Office 365 Video was announced a few years ago it came with little fanfare as it was really just the beginning of an enterprise video solution. Over the past year the solution has continued to evolve and is now becoming a valuable tool in the tool-belt of Office 365.

Picture1

When you sign up for Office 365 you are at the mercy of Microsoft as far as the releasing of new technology. This is normally a new release philosophy that your company will need to evolve into. There are different ways to control the flow of information being release in Office 365 using things like First Release or even another tenant but this post is specific to the scenario controlling Office 365 Video.

To start…all of this information is only as valid as to when this post was written (April 2016).  As O365 is changing often this may not be how to do this in the future.

A few quick notes:

  • By default the Office 365 Video portal is turned on
  • By default anyone who has an appropriate license can create channels
  • The Video tile will be available to anyone who has an appropriate license
  • The Office 365 Video portal hub is a site collection in SharePoint Online

2016-04-11 12_12_02-Start

Steps to disable the Office 365 Video Portal

1 – Navigate to your SharePoint Online Admin Center

  • Option 1:  Direct URL (replace contoso with your tenant info):  https://contoso-admin.sharepoint.com
  • Option 2:  Navigate to Office 365 Admin Center -> Use the left navigation to open the SharePoint Admin Center

2016-04-11 12_21_16-Start

2 – Click “settings” in the left navigation of the SharePoint Admin Center

2016-04-11 12_22_28-Cortana

3 – Scroll down down to the section titled: “Streaming Video Service”

  • Check “Disable streaming video through Azure Media Services and disable the Video Portal”

2016-04-11 12_25_30-Photos

  • Click “OK” at the bottom of the page

4 – Wait….Wait…..keep waiting….It will take a few minutes for the tile to be removed.

2016-04-11 12_35_26-Start

5 – If you try to navigate directly to the Video portal url (https://contoso.sharepoint.com/portals/hub) you will now see a new message

2016-04-11 12_43_27-Photos