SharePoint Modern Library Experience: command ribbon

SharePoint Modern Library: Cannot exit “Expand content” mode

After clicking on the “Expand content” command button I have found myself scratching my head:

  • Where is the “Collapse content” command button?
  • Where has the command ribbon gone?
SharePoint Modern Library Experience: “Expand content” command

Well, the command ribbon is still there, it is just hidden by the ‘top placeholder’. Or more precisely, what has loaded into the ‘top placeholder’. For example: Hub Site Navigation or a SPFx Extension.

Having done a few web searches, I’m not the only one seeing this bug and apparently Microsoft is planning to fix the bug. In the meantime, here are two workarounds:

  1. Delete your browser cache (including cookies) and reload the page
  2. Open your browser’s developer tools (e.g. press F12).
    • Select the ‘Console’ tab
    • Paste in the following code
    • Press enter
document.querySelectorAll("button[title='Collapse content']")[0].click();

And now you should see the modern command ribbon again.

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

Office 365 Service Health

Need to check the health of your Office 365 Tenant and Services?
Here are some links that may help:

Office 365 (Tenant) Service health
https://portal.office.com/adminportal/home#/servicehealth

Microsoft 365 Service health status
https://status.office365.com

Office 365 outage map
https://downdetector.co.nz/status/office-365/map

Manage the life cycle of private channels in Microsoft Teams

Microsoft has published a very useful article in “Manage the life cycle of private channels in Microsoft Teams”, which can be found here: https://docs.microsoft.com/en-us/microsoftteams/private-channels-life-cycle-management

In this post I have added my thoughts below some of their key points.

Set whether team members can create private channels

Team owners can turn off or turn on the ability for members to create private channels in team settings. To do this, on the Settings tab for the team, turn off or turn on Allow members to create private channels.

Microsoft
Microsoft Teams: Team Settings

As an admin, you can use Graph API, however currently there is not an option available for PowerShell (e.g. using the Set-Team PowerShell cmdlet – version 1.0.3).

Set whether users in your organization can create private channels

As an admin, you can set policies by using the Microsoft Teams admin center or PowerShell to control which users in your organization are allowed to create private channels.

Using the Microsoft Teams admin center

Use teams policies to set which users in your organization are allowed to create private channels. To learn more: https://docs.microsoft.com/en-us/microsoftteams/teams-policies

Microsoft

Using PowerShell

Use CsTeamsChannelsPolicy to set which users in your organization are allowed to create private channels. Set the AllowPrivateChannelCreation parameter to true to allow users who are assigned the policy to create private channels. Setting the parameter to false turns off the ability to create private channels for users who are assigned the policy.

Microsoft

NOTE: This cmdlet is currently (20/11/2019) only available in limited preview in the pre-release Teams PowerShell module.

Create a private channel on behalf of a team owner

As an admin, you can use PowerShell or Graph API to create a private channel on behalf of a team owner. For example, you may want to do this if your organization wants to centralize creation of private channels.

Microsoft

Pretty straight forward, for more information see the links below:

Find SharePoint URLs for all private channels in a team

Whether you’re looking to perform eDiscovery or legal hold on files in a private channel or looking to build a line-of-business app that places files in specific private channels, you’ll want a way to query the unique SharePoint site collections that are created for each private channel.

As an admin, you can use PowerShell or Graph APIs commands to query these URLs.

Microsoft
$sites = get-sposite -template "teamchannel#0" 
$groupID = “<group_id>" 
foreach ($site in $sites) {
  $x= Get-SpoSite -Identity $site.url -Detail; 
  if ($x.RelatedGroupId -eq $groupID) {
    $x.RelatedGroupId;$x.url
  }
} 
GET https://graph.microsoft.com/beta/teams/<group_id>/channels?$filter=membershipType   eq 'private'    

Compliance, eDiscovery and legal hold are all very important considerations when working with SharePoint and Microsoft Teams and I don’t see Private Channels being different. With that in mind, being able to quickly locate and manage the Site Collections (and data) is essential.

Currently there is not way to list and manage site collections created by Private Channel within the SharePoint Admin Center. Plus the PowerShell implementation is lagging behind the Graph API. That said with a little effort we can work around these limitations.

List and update roles of owners and members in a private channel

You may want to list out the owners and members of a private channel to decide whether you need to promote certain members of the private channel to an owner. This can happen when you have owners of private channels who have left the organization and the private channel requires admin help to claim ownership of the channel.

As an admin, you can use PowerShell or Graph APIs commands to query these URLs.

Microsoft

Pretty straight forward, for more information see the links below:

Microsoft Teams: Team Settings

First impressions of Private Channels in Microsoft Teams

We finally have Private Channels in Microsoft Teams, here are some of my first impressions.

👍 Private Channels are created without the Wiki tab

👉 Private Channels create a new SharePoint site collection (based upon a modern Team)

👉 A Private Channel’s site collection’s Alias (URL) is prefixed with its “parent” Team’s Alias (URL):

  • Team Name: Human Resources
  • Private Channel Name: Annual Reviews
  • https://[company].sharepoint.com/sites/HumanResources-AnnualReviews

👍 Space re removed from a Private Channel’s title when a site collection’s Alias (URL) is created:

  • Private Channel Name: Annual Reviews
  • https://[company].sharepoint.com/sites/HumanResources-AnnualReviews

👎 Private Channels’ site collections are not available to see within the ‘modern’ SharePoint Admin Center. Other site collections are listed under the Active Sites page.

💀 Deleting a Private Channel also deletes the site collections (as expected). However the site collections is not available for recovery within the SharePoint Admin Center, under the Deletes Sites page.

👉 Private Channels site collection’s logo is not inherited from the Team and cannot be updated using the Microsoft Teams App. However it can be changed using the modern SharePoint UI.

👉 A Private Channel’s site collection’s homepage is the Documents library. It does not have the Site Pages feature activated and therefore does not have a Site Pages library.

SharePoint Online Permissions

Overview of SharePoint Online’s “out-of-the-box” permissions:

Permission Restricted View Read Contribute Edit Design Full Control
Can view pagesYesYesYesYesYes Yes
Can view list items
and documents
YesYesYesYes Yes Yes
Download documentsNoYesYesYes Yes Yes
Can add, update
and delete list items
and documents
NoNoYesYes Yes Yes
Can add, edit and
delete lists
NoNoNoYes Yes Yes
Can approve
and customize
NoNoNoNoYes Yes
Has full controlNoNoNoNoNoYes

SharePoint Online permissions, listed in reverse order:

  • Restricted View
    View pages and documents, but not historical versions or user permissions
  • Read
    View pages and items in existing lists and document libraries and download documents
  • Contribute
    View, add, update, and delete list items and documents
  • Edit
    Add, edit, and delete lists; view, add, update, and delete list items and documents. By default, this permission level is assigned to the Members group
  • Design
    Create lists and document libraries, edit pages and apply themes, borders, and style sheets on the site. There is no SharePoint group that is assigned this permission level automatically
  • Full Control
    Contains all available SharePoint permissions. By default, this permission level is assigned to the Owners group. It can’t be customized or deleted.

For more information, see Microsoft pages:

Microsoft Flow: How to embed an image in an email

Microsoft Flow: How to embed an image in an email

It’s simple when you know how!

Task:

Using Microsoft Flow, trigger sending of an email with an embedded image.

  • The image will be stored in a SharePoint Library
  • We will assume you have already created connects to:
    • Office 365 Outlook
    • SharePoint

Steps:

  1. Create a new Flow:
    1. Select: +New > Instant—from blank
    2. Click: Manually trigger a flow
  2. Add the 1st actions:
    1. Search for SharePoint > Get file content using path
    2. Select the action
    3. Site Address: either select or ‘enter custom value’
    4. File Path: enter the path from the site collection (e.g. ‘/Style%20Library/_Company/Images/EmailSignature.jpg’)
  3. Add the 2nd actions:
    1. Search for Variables > Initialize variable
    2. Select the action
    3. Name: Enter ImageTag
    4. Type: Select String
    5. Value: This is the trick bit!*
      1. Enter: <img src=”data:image/jpeg;base64,” alt=”My Image” />
      2. Next click between ‘64,‘ and ‘” alt
      3. Add dynamic content
      4. Select: Expression fx
      5. Enter .$content
      6. Placing you cursor before the .$content click: Dynamic content
      7. Locate and select File Content
      8. Click OK
  4. Add the 3rd and last actions:
    1. Search for Office 365 Outlook > Send an email
    2. Select the action
    3. To: enter your email address
    4. Subject: Microsoft Flow: How to embed an image in an email
    5. Body: <p>This is my test email, you should see an image below</p><p></p>
    6. Click between the last <p></p> tags
    7. Click: Add dynamic content
    8. Locate and select the ImageTag variable
    9. Is HTML: Select Yes
  5. Save the Flow

*Here is the full code/expression:

<img src="data:image/jpeg;base64,@{body('Get_file_content_using_path')['$content']}" alt="My Image" />

So what tripped me up?

On my first attempt I tied using the File Content variable directly within the body of the email, only to see binary… Note: This works fine when attaching the file as an ‘attachment’ (see Attachments Content).

Plus I struggled to find a way to convert binary to base64. That was before I realised I didn’t need to do all that work, hence this blog post…