SharePoint – Online Security and Security by Obscurity

March 22, 2019

SharePoint Online Security settings are scattered all around… Sad smile

Next problem is that the Online version OOTB might not give you all the security features you need ?

So you will have to apply some tricks to fool the users.

Here is an overview of what is to your disposal ….

SP Security :

SharePoint delivers a Security Model that is a combination of AD user & Groups with SP Users & Groups.

See Managing the Security Model for more info.

These users and “Nested” Groups can be used to secure your Site Collections on different levels

image

Using Site Settings –> People and Groups and Site Permissions

image

To set security on different levels

1. Site level
2. List and Library security
3. Record level Security

See here for more info

What is Record level Permissions versus Record level Security, see here for more info.

Setting Record Level Security will also have a performance hit !  So try to avoid it as much as possible.

– Search Security
Via Site Settings you can refine the security on the Search

image

So let’s say you don’t want to have the users see the search EVERYTHING option

image

Go to SITE SETTINGS –> SEARCH Settings

image

Delete the EVERYTHING from the list.

Disable File and Folder Sharing :

image

Go to SITE SETTINGS –> Site Permissions –> Access Request Settings

 

SP Security by Obscurity :


Using Target Audience settings :

This is not a real security because the SP Search will ignore the target audience settings !!


– Hiding List or Document Library records using Audience Targeting :

On the list or Library activate Audience Targeting

image

You have to use it in combination of the Content Query Web Part

See here on how to.

– Hiding Web Parts using Audience Targeting :

This is done using the EDIT Web Part feature

image

In the Advanced Section you specify the TARGET Audience user(s) or group(s).

image image

You can use different other settings to HIDE Web Part features from the users

– Select a different VIEW to limit and filter the records shown in the Web Part. And hide the TOOL Bar if needed.

image

In the MISCELANEOUS section you can hide different sections

image

Here you decide to hide the Web Part Toolbar and only leave the INLINE LIST SEARCH available.

– Hiding Search options using Audience Targeting

image

Next you can  set Targeting Audience using SP Groups to limit the search this site feature for certain users.

– Hiding Objects using CSS

Examples to hide the SEARCH box on a site, and more …

<style type="text/css">  
#DeltaPlaceHolderSearchArea {display: none;}
.ms-InlineSearch-SearchStatus {display:none;}
.ms-cui-topBar2 { display : none; }
</style> 

– Hiding Objects using JQuery, give the same effect.

– Hiding Objects using SharePoint Designer : See below

Tools :

1. SharePoint Designer

Hide Libraries from the all site contents

image

image

Use SP Designer Workflows to automate Security settings on Lists and Libraries or Records / Documents

See here for how to.

First activate the Workflows can use app permissions using Site Features

image

Go to Site Settings –> Site App Permissions

image

Copy this part of the GUID and insert it in

image

Go to the Site Collection URL and add this part  “_layouts/15/appinv.aspx”

Workflow App Permissions : See here for the extra steps to complete the whole process

2. PowerShell

Use PowerShell to automate Security settings on Lists and Libraries or Records / Documents

Or to create reports to get visibility on Security.

See here for some good examples

So if you combine all of them, you can go a long way !

But it is important that you have a good security strategy, before starting to build your application.

Enjoy !

Advertisements

SharePoint–Online Publish a Power BI report (Personal Ed.)

January 5, 2018

Ever wanted to publish a Power BI report to SharePoint Online ?

Which is not out of the box functionality (It is for the PRO version of Power BI)

 

Solution :

Step 1. Get the link of the report

In your Power BI environment go to the report to publish –> File –> Publish to Web

image

Next copy the link code ….

image

Step 2. Create a Web Part Page

 

Add a Page Viewer Web Part

image

And add the Report link from Step 1.

 

Step 3. Save the page and see the result

 

image

 

Of course this does not give you all the full features of the Power BI Pro version.

But can be good enough to do some prototyping or publishing BI information.

image

Bonus is the fact that it will update automatically based on the Power BI Schedule frequency Smile

 

PS : Keep in Mind that your Tenant Admin needs to give you permission to Publish to the Web

 

image

 

Enjoy!


PowerBI – Access SharePoint list data

February 5, 2017

As I showed in a previous post SharePoint is different Interfaces you can use to access as a data source.

https://audministrator.wordpress.com/2015/01/26/sharepoint-interfaces/

So I we know it can expose it’s List data using the  REST or oData protocol.

Open PowerBI and go to GET DATA menu.

Choose OData Feed to connect to your SharePoint data source

 

image

Once logged you can choose from your lists

 

image

And play around to make your data visible using all the features from PowerBI Smile

image

Once Finished you can publish your result

 

image

Once published you can reach out on the mobile apps.

 

image


SharePoint – SSRS Web Part Parameter Issue

January 31, 2015

We had an annoying problem with a published SSRS report in SharePoint that uses a Parameter.

Most likely this appears only in combination with a external data source like an ODBC connection that retrieves data from a data source not within the current domain ?

This strange ‘bug’ I would call it so far is not showing when your run the report from within the Report Designer, but only from within SharePoint.

So I suspect that this is a malfunction in the SSRS front end Web Part.

Problem :

When selecting the first time a parameter in the report, it returns all the filtered data. But when selecting a new parameter value, for the second time, it returns a blank page ? And the parameter box jumps down.

image

Solution :

After debugging with trial and errors, we found out that if you add a Default Value, in the parameter field, the problem is solved.

image

If you get the parameter values from a different Dataset, you can also specify the Default Value using the Get Values from a Query option. But this is not needed to make it work.

Just give any valid default value in the Specify Values field will do the job as well.

image

Again, this problem is not occurring in the Report Designer itself?

So the SharePoint users are happy to see that this annoyance is gone Smile


SharePoint – Interfaces

January 26, 2015

SharePoint has many interfaces, and you tend to get lost in them over time Winking smile

So here is a summary of the most frequently used ones on the output side of SharePoint.

Web Service Interface :

When you want to get the XML response of the list definitions, use this syntax :

http://YourSite/SiteCollection/_vti_bin/Lists.asmx?wsdl

This will give you a the SOAP response

image

Or you can use this syntax :

http://YourSite/_vti_bin/owssvr.dll?Cmd=Display&List={GUID}&XMLDATA=TRUE

To get the GUID of a list, just go to the Settings Page of the list, and look at the URL. (Not the VIEW)

image

To use the GUID you need to do a URL decoding. There are multiple online decoders on the net.

Once you have put it all together the result will look like this.

image

Here you can find the z:row Nodes and Attributes, you need for JQuery SPServices functions.

REST or oDATA interface

http://YourSite/_vti_bin/listdata.svc/

image

You can add the List Name, after here _vti_bin/listdata.svc/ListName to get the REST interface of that list.

You get an RSS Feed Like this :

image

Where you have a Search and a few sort options.

URL filter and Sort Options

You can also add filter and sort parameters in the URL, like this :

?FilterName=Title&FilterMultiValue=Task&SortField=Title&SortDir=Desc

URL Query interface

Of course you can use the usual Query string interface to pass on variables.

SSRS Interface

When you have the SSRS running in integrated mode you can access the reports using the SSRS URL Parameter Interface.

On the input side you can have as well a database, SOAP and REST connector Interface

Using SP Designer

image

Example of a SOAP interface

There is of course much more to tell about SharePoint Interfaces and Technologies.

See here on How To : How to Access Data on SharePoint

And as a scripter you have access to most of the interfaces, see here for some examples

Example of accessing the REST interface

More options, see here URL Protocol

 


SharePoint – Search Slow opening documents

January 25, 2015

At the moment I have an problem in a certain side collection. Where the search result page appears quickly.

But when clicking any of the results to open a document, it takes more then 5 seconds Sad smile

So the next step is to see if a full Crawl of the search database, does not solve the problem.

Solution :

Go to Central Adminstration

clip_image002

Next go to Manage service applications –> Search Service Application

image

Go to Local SharePoint Sites and select Full Crawl from the dropdown menu.

There are more interesting options in the side menu.

Or you can use PowerShell to do the same.

CLS

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null)
{
    Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
        
# Get current Status
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | select Name, CrawlStatus



Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping currently running crawl for content source $($_.Name)..."
    #    $_.StopCrawl()
        
        do { Start-Sleep -Seconds 1 }
        while ($_.CrawlStatus -ne "Idle")
    }
    
    Write-Host "Starting full crawl for content source $($_.Name)..."
    # $_.StartFullCrawl()
}

After starting the Full Crawl everything was working again Smile


SharePoint – Using JQuery & SP Services

January 24, 2015

If you are developing SharePoint you just can’t get around JQuery and the marvelous SPServices. Especially if you are dealing with SharePoint Web Services.

There are many hits on the internet if you type in these 2 keywords. But nevertheless there are very few post explaining you how to and which approach and tools can help you in your project.

Let’s say you you want to retrieve some Document ID’s & Names from documents linked into a list Form Body Text.


$(document).ready(function(){

$.fn.SPServices({
    operation: "GetListItems",
    async: false,
    webURL: "/webs/sitecollection/site",
    listName: "YourListName",
    CAMLViewFields: "",
    CAMLQuery: "1503",
    completefunc: function (xData, Status) {

    // Debug
    //alert(xData.responseText);

var liHtml = ""
      $(xData.responseXML).SPFilterNode("z:row").each(function() {

      //  $("#tasksUL").text(xData.responseText); // Debug info 

      liHtml =  "</pre>
<ul>
	<li>" + $(this).attr("ows_FileLeafRef") + "</li>
</ul>
<pre>
";
         $("#tasksUL").append(liHtml);
      });
    }
 });

});</pre>
<ul id="tasksUL"></ul>
<pre>

The code above will do so. But the mystery is which is the ows_xxx XML attributes you are looking for to get the File Name appearing in your Form.

Solution :

Uncomment this section in the code :

$(“#tasksUL”).text(xData.responseText);

And comment this line :

// liHtml =  “<li>” + $(this).attr(“ows_FileLeafRef”) + “</li><br/>”;

This will retrieve the bare output of the return SOAP Envelope in your form.

image

You can select it out of your Form, and paste it in for example XML Notepad.

image

It’s got some millage but still going strong. Smile

image

Here you can see all the Nodes and Attributes in the tree structure.

The one we are interested in is the attribute ows_FileLeafRef in the node z:row

That’s where the document ID and Name appears in.

image

Once we use that in our code, the result is looking good.

I got the 2 document references from a Document Library somewhere else in SharePoint using SP Web Services !

image

Hopefully this can clear some mist on how to get all the missing mystery information and parameters correct.