Tuesday, May 11, 2021

SharePoint Modern Page: Site Collections Directory

Adding a site collection directory to a SharePoint classic page was easy. However, with the new modern pages in SharePoint, it has become more challenging. A quick, easy way I have found to accomplish this need is to use the Highlighted Content web part and a custom query. See below for details.

1. Add the Highlighted Content web part on the page where you want the site collection directory.

2. Edit the Highlighted Content web part, select 'Custom query', select 'All sites' for the Source, and then add the following custom query in the 'Query text (KQL)' box: Path:"https://tenant.sharepoint.com/sites/*" contentclass:STS_Site. See screenshot below for an example. To sort the results on the page, you are given the option to use a managed property to sort on. As you can see in the screenshot below, I searched for the term "string", and ultimately selected the 'RefinableString00" managed property, which sorted my site collections by site name.



3. Republish the page.

Thursday, February 25, 2021

Restore a deleted site collection (SharePoint 2010 / 2013 / 2016 / 2019 On-Premises)

Did you know that you can now restore a deleted site collection? Microsoft has issued two PowerShell commands for this need. The only caveat is that they only work in an on-premises farm. I tested both commands recently, and I can tell you firsthand that they work!

Get-SPDeletedSite: Gets a list of deleted site collections.

https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/get-spdeletedsite?view=sharepoint-ps

Restore-SPDeletedSite: Restores a deleted site collection.

https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/restore-spdeletedsite?view=sharepoint-ps

Friday, August 28, 2020

Item-Level Permissions in SharePoint Online using Power Automate

As you fellow SharePoint gurus already know, SharePoint 2010 Workflows will be retired this year. This of course also means that we will eventually lose the all important 'Replace List Item Permissions' action in SharePoint Designer, which essentially gave us the ability to implement automated item-level permissions for a SharePoint library or list. I recently took the time over a weekend to evaluate any good alternative (non 3rd party) solutions that I could think of, and it appears that Power Automate is now the best way to go. However, there is one drawback to this new approach -- you can only assign Edit or Read level permissions to any given item in a SharePoint library or list.

1. Go to the Power Automate site, which at the time of this article is located at https://us.flow.microsoft.com/en-us. Be sure to login.

2. Create a new automated blank flow using the 'When an item is created' SharePoint trigger.

3. Add the remaining logic as shown in the screenshot below.

NOTES:  1) The ID is available in the dynamic content section that appears once you click inside the 'Id' field in your flow.  2) I also used the dynamic content section for the Recipients, but you can manually type in email addresses as long as you separate them with a semicolon.



Monday, June 22, 2020

SharePoint Online Wiki Homepage: Change Top Suite Bar Color (CSS)

To change the color of the top suite bar on a SharePoint Online Wiki homepage, add a Script Editor web part to the page and add the following CSS code:

#suiteBarTop, #O365_NavHeader, #O365_AppName, #O365_MainLink_NavMenu, #O365_MainLink_Bell, #O365_MainLink_Settings, #O365_MainLink_Help, #O365_MainLink_Me  

{

background: #0078d4 !important;

}

That's it. Enjoy.

Wednesday, June 3, 2020

SharePoint Roles are Business Roles, Not IT Roles

SharePoint is a platform for BUSINESS SOLUTIONS. Without business purpose, SharePoint is worthless. And because SharePoint professionals work so closely with the core areas of business (accounting, business development, finance, operations, etc.), I wholeheartedly believe SharePoint roles are business roles, not IT roles.

Just a little 'food for thought' for the next time you are planning to hire a SharePoint professional.

That is all for this post.

Tuesday, April 14, 2020

Quick Tip: Add 'Find a file' search box to Document Library Web Part

Another Quick Tip:

To add the 'Find a file' search box to a document library web part on a page, simply edit the web part, expand the Miscellaneous section, and select the checkbox to "Display search box". That's it.


If only Microsoft made everything that easy! :)

Have a great day.

Lesson Learned: Three-state workflow feature is the IssueTrackingWorkflow feature

Recently I had an issue in which I could not deploy a new solution to a SharePoint 2016 on-premises site collection due to a dependent feature not being activated: the IssueTrackingWorkflow feature, which has a GUID of "fde5d850-671e-4143-950a-87b473922dc7". After a few hours of research, I discovered that this feature is actually the "Three-state workflow" site collection feature. After activating this feature on the site collection, I was able to successfully deploy the new solution without any issues. Here are few tips:

To see if a site collection feature is activated, here is the PowerShell script:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$featureGuid = "fde5d850-671e-4143-950a-87b473922dc7"
$site = Get-SPSite http://SiteCollectionUrl
$feature = $site.Features[$featureGuid]
if ($feature -eq $null) { "feature not activated" } else { "feature activated" }

To active the site collection feature in PowerShell:

$site = Get-SPSite http://SiteCollectionUrl
$site | Get-SPSite -limit all | ForEach-Object {Enable-SPFeature -Identity "fde5d850-671e-4143-950a-87b473922dc7" -Url $_.Url}
$site.Dispose()

Done.

Tuesday, August 13, 2019

SharePoint Online: Cannot create a new classic site collection

Today I ran into an issue in SharePoint Online in which I could not create a new site collection using one of the classic templates. The SharePoint Administration Center allowed me to perform the steps to create the new site collection (many times, actually), but it never would actually provision it. After a bit of troubleshooting, I realized that I had initially created the new site collection using the modern experience, and I immediately deleted it. I then discovered that by default, SharePoint Online now temporarily holds deleted sites under an area named 'Deleted Sites,' and the only way to permanently delete the site collection is to run the following command in the SharePoint Online Management Shell.

Remove-SPODeletedSite -Identity https://company.sharepoint.com/sites/sitecollection

After running this command, the site collection is permanently deleted, and the URL suffix (alias) is now available for you to use again for your new classic site collection.

Have a great day.