SharePoint online: Share your excel report to anonymous users

Sometime, you have an excel report located in your SharePoint Online, and you want to share it to anonymous user (not require to login), how can you do that?

First, you need to turn on “Allow sharing to authenticated external user and using anonymous access link”

AdminCenter-ExternalSharing

Then, select the site collections that you want to share to anonymous, turn on this “Allow shareing with all external users, and by using anonymous access links”

AdminCenter-SiteCollectionSharing.png

Now, we go to the excel report that you want to share to external user and click share.

ClickShare

Then copy the link in the dialog.

So, the link should be similar this:

https://yoursite.sharepoint.com/:x:/g/publishing-report-center/publishing-sale-reports/ETflhztYjGdCljjlf-0nt8kBICp–iVrpej5m2b–sGmQA?e=7r7fRe

But wait, you don’t want to share the whole file, you just want to share the report in the file. Humm, let’s get the report link first:

In your excel online file, click to File -> Share -> Embed

TakeShareOption

Select the report area in the embed dialog, then you will have a script similar this:

< iframe width=”1024″ height=”1024″ frameborder=”0″ scrolling=”no” src=”https://yoursite.sharepoint.com/publishing-report-center/publishing-sale-reports/_layouts/15/Doc.aspx?sourcedoc={3b87e537-8c58-4267-9638-e57fed27b7c9}&action=embedview&ActiveCell=’OverviewTable’!B4&Item=TableOverview&wdHideGridlines=True&wdInConfigurator=True“></ iframe>

Now, you can combine 2 links above to have a final link for your report. The final link should be like this:

https://yoursite.sharepoint.com/:x:/g/publishing-report-center/publishing-sale-reports/ETflhztYjGdCljjlf-0nt8kBICp–iVrpej5m2b–sGmQA?e=7r7fRe&sourcedoc={3b87e537-8c58-4267-9638-e57fed27b7c9}&action=embedview&ActiveCell=’OverviewTable’!B4&Item=TableOverview&wdHideGridlines=True&wdInConfigurator=True

Use the tool online to make that url shorter, then from now on, you can send that link to anonymous user to see your report.

Good luck!

PnP Tools for SharePoint Modernization scanner + GetWebLoginClientContext

GetWebLoginClientContext

$authenticationManagerSiteScope = New-Object -TypeName OfficeDevPnP.Core.AuthenticationManager
$authenticationManagerSiteScope.GetWebLoginClientContext(“https://yoursite.sharepoint.com&#8221;);

https://github.com/SharePoint/PnP-Tools/tree/master/Solutions/SharePoint.UIExperience.Scanner

https://github.com/SharePoint/sp-dev-modernization/tree/master/Tools/SharePoint.Modernization

 

 

 

Get SharePoint site/subsites template using javascript

var siteCollections = [
https://forvaltningdev.sharepoint.com&#8221;
];

siteCollections.forEach(function (site) {
var webCollection = null;
function getWebTemplate() {
var context = new SP.ClientContext(site);
//var context = SP.ClientContext.get_current();
var web = context.get_web();
context.load(web);
context.executeQueryAsync(
function () {
var webTemplate = web.get_webTemplate();
var configuration = web.get_configuration();

var templateName = webTemplate + “#” + configuration;
var isTeamSite = templateName === “STS#0”;

console.log(site + “,” + templateName + “,,” + (isTeamSite? “Classic Team Site”: “”));

$.ajax({
url: site + “/_api/web/webs/?$select=title,ServerRelativeUrl,Created,webTemplate,configuration”,
method: “GET”,
headers: {
“Accept”: “application/json; odata=verbose”
},
success: function (data) {
$.each(data.d.results, function (index, item) {
templateName = item.WebTemplate + “#” + (item.Configuration + 1);
isTeamSite = templateName === “STS#0”;

console.log(site + item.ServerRelativeUrl + “,” + templateName + “,,” + (isTeamSite ? “Classic Team Site” : “”));
});
},
error: function (data) {
//console.log(site + “,,Unable to get sub sites”);
}
});

},
function (sender, args) {
//console.log(site + “,,Unable to check the site template”);
}
);
}
getWebTemplate();
});