SharePoint Online: How to exclude People from Search

The other day while I was working in a project, a client who has synced the OnPrem AD to Online, asked me if it was possible to hide some people search results, because it was showing irrelevant information from some people.

It is not the typical filter that you can set in the AADConnect to filter by OU, it was needed to filter based on a profile property.

So, what we can do? In this case to create a custom property in SPO admin Center and use Search with a DT to hide the search results that we want.

Let’s say in this case, that I need to create a property called “ExcludePeopleSearch” as a Boolean and the privacy set to “everyone”

Once this has been created, we need to add some values to some profiles, in order to contain information and the search be able to index the results, generally it takes about 24 hours to index all the information.

Once it have been indexed, you can can map that to a search managed property, and add that to the search based Directory to get them excluded.

Advertisement

Private Teams will be discoverable in Search

Nowadays, if you want to join a Private Team, the only way to do it is by being invited by an admin of the group. But this will change in the next days, I found the following annouce in my tenant:

MT

So, will be possible to find the groups in SharePoint Search or even searching the groups in the Microsoft Teams App. I think this make sense, you find the group and if it’s necessary you request access to the group.

The only thing that is it necessary to take into account is to be aware of the name policy that the groups will have, if you don’t want a certain name group in your tenant, check it before, and if it’s necessary, execute the Set-UnifiedGroup command with the attribute HiddenFromAddressListsEnabled to $true

It’s great to see how Microsoft is improving all the collaboration tools 🙂

SPO – Which MP should I use for Search?

This is a reminder for myself, sometimes I forget which type of Managed Propery I have to use in SPO in order to make search by CQWP, so, depending on the type of column you will need to use different type of preset Managed Properties.

Managed property name Data type for mapping
RefinableDate00 – RefinableDate19 Dates.
RefinableDecimal00 – RefinableDecimal09 Numbers with max three decimals.
RefinableDouble00 – RefinableDouble09 Numbers with more than three decimals.
RefinableInt00 – RefinableInt49 Whole numbers.
RefinableString00 – RefinableString99 Strings, Person or Group, Managed Metadata, Choice and Yes/No

So, after you have configured this, you’re ready to go. Remember that before you can configure a MP, it is necessary to have values in the column in order to be able to crawl this column and then be able to do the correct mapping.

Get a list of O365 groups

The inclusion of O365 groups is great, it enables users to share documents, planner, calendar. Also taking into account that everyone is able to create a group.

However the problem starts when a user ask for the group url of the site collection, at first glance, you will thinlk to go to the SharePoint Admin Center and search for the site collection, and then you realize, that this site collection that has been created by groups, simply does not exist.

So what we can do? A simply approach will be use a Search Results Web Part in SharePoint Online to show those Site Collections, so let’s use it 🙂

query.png

So by doing this, we will be able to show all the groups that has been created in O365 and also taking into account that the security trimming will be respected.

The only drawback to this solution will be that the private groups won’t be listed in the search results. Also to improve this query, will be great to be able to show the Yammer groups or other locations where we store the documents.

File Shares as Content Source in SharePoint 2013 On Premises

Hi all!

Another quick post about file shares and SharePoint:

  1. Identify your crawl account, because this account will be used to index the file share (unless specified differently with a crawl rule), so it is necessary to have read access to the file share to this account
  2. If crawled files in file share system contain metadata, this will be used by the search refiners in SharePoint
  3. Security trimming is respected, so when end users search the document in the search site, it will be displayed according to the permissions given on the files and folders.
  4. Only metadata of the documents will be stored in SharePoint, not the documents
  5. It is not possible to get a preview from Office documents that are stored in File Shares, to get a preview, you’ll need to use third party tools.

That’s all!

Search not working – Query component failed status

Hi all!

I still don’t know if it’s related or not, but after changing the time in our UTC zone, all the query search in a SharePoint farm suddenly stopped working.

At the beginning with the errors that I had, I was thinking in the Index component, but when I accessed to the components, I was able to see that the query component was in red, so it was the first indicator that something was not working fine.

My first thought was to check the logs to see If was able to see anything, and in fact I found a lot of errors related with the query component, some of them like the following:

SearchServiceApplicationProxy::Execute–Error occured: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Tried IMS endpoints for operation Execute: Operation sent to IMS failed: Resource saturation, try again later. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: Microsoft.SharePoint.SPException: Tried IMS endpoints for operation Execute: Operation sent to IMS failed: Resource saturation, try again later. at
WcfSendRequest: RemoteAddress: ‘net.tcp://servername/97C247/QueryProcessingComponent1/ImsQueryInternal’ Channel: ‘Microsoft.Office.Server.Search.Query.IImsService’ Action: ‘http://tempuri.org/IImsService/Execute’ MessageId: ‘urn:uuid:86db249c-bb2a-427f-bbbb-219f0d00e87c’ f861b39d-b40f-b033-363b-cc73f6b053c4
Ims::Execute–Error occured: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.tcp://servername/97C247/QueryProcessingComponent1/ImsQueryInternal that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. Server stack trace: at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper& timeoutHelper) at

So… at the beginning I was thinking what can I do with this errors? My first thought was to check available disk free space.

Everything was fine, so.. next thing to check, the following thing I checked was the SharePoint cache, everything was fine, but just in case I cleaned SharePoint cache, then I checked the components of Search and was still in red, so the problem started to be big.

But, suddenly It pops out of my mind that something in the logs, so my next move was to restart the search services. In first case the host controller service. I restarted the service, once it was restarted I checked again the components and were all in green. Yihaaa!

I checked the search results on the portal and I was able to perform queries and all the WP configured were working.

I stopped investigating what was the root cause of the problem, but for next time I know what to do first.

Till nex time!

The search application “SEARCH SERVICE APPLICATION” on server did not finish loading

Hi folks,

Recently, I came across with the following issue, I Opened the Search Service Application in one of the Servers in the farm, and when I click on Content Sources I was getting:

The search application ‘XXXX’ on server XXXX did not finish loading. View the event logs on the affected server for more information.

After spending some time to fix the problem I found the following command:

Psconfig -cmd secureresources

secureresources

It takes a couple of minutes to finish it.After doing this I was able to enter again to Content Sources in the Search Application

Hope it helps!

 

How to prevent from being indexed by Google

One of the problems of publish SharePoint in a public website is that the internal webpages with sensitive content will be indexed. To prevent this we can set an a IIS redirection rule, but if we want to make it simple, we can make a file config in the root file to prevent to the search robots to not to crawl certain content. To do this, we can create a robots.txt with the following:

User-agent: *
Crawl-delay: 10
Disallow: */_layouts/
Disallow: */_catalogs/
Disallow: */Lists/
Disallow: */Forms/

You can get more info from a previous post: https://sharepointrescue.wordpress.com/2015/05/20/what-is-robots-txt/

Till next time!

How to remove Index components

Hi folks!

Last day I was doing an installation I had a weird problem, I configured the search application, and then I executed a wonderful PS to configure it again trough several servers, but then when I accessed to AC, I realized that it was showing 2 index components inside the same server. So what happened? I don’t know, but I want to leave the server with only 1 component, although the other one it is not being used.

So, first of all I executed some PS codes to confirm my guess:

search1

So, as you can see I’m having to Index components in different locations, one stored in C:, while the other one is stored in E. I want to eliminate the Component1, because it was created in C and I want all my Search components running in other location than the OS drive.

If you need to check the previous step, execute the following:

$ssa = Get-SPEnterpriseSearchServiceApplication “SKM_PRE_Search_App”
$current=Get-SPEnterpriseSearchTopology -SearchApplication $ssa
Get-SPEnterpriseSearchComponent -SearchTopology $current | ? {$_.Name -eq “IndexComponent1”}

Ok, once we arrived at this point, we want to eliminate the IndexComponent1, how it’s not possible to do changes in an active topology, we need to clone the Search Topology, do the changes that we want to promote, active the new topology and remove the old one. Sounds a bit strange, but it is more easy to understand with some code:

$current=Get-SPEnterpriseSearchTopology -SearchApplication $ssa
$clone=New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $current
$comp=Get-SPEnterpriseSearchComponent -SearchTopology $clone | ? {$_.Name -eq “IndexComponent1”}
Remove-SPEnterpriseSearchComponent -Identity $comp -SearchTopology $clone
Set-SPEnterpriseSearchTopology -Identity $clone
Remove-SPEnterpriseSearchTopology -Identity $current

Once we executed the steps before, we are done, but not in my case, because I received a weird error removing the topologies, so I need to check some things as the next image shows:

search2

As it possible to be seen, the image shows some inactive topologies, so with a PS that I posted here I was able to delete the inactive topologies. And finally as it can be seen, my component count from the Search Service, only shows 6 components instead of 7.

Work done!

SharePoint 2013 Search – Removing Inactive Search Topologies with PowerShell

One of my customers called me saying that they had some search topologies in their farm, so they wanted to remove the inactive topologies, but how we can do this? You guess it right, with PowerShell 🙂

So if you execute the following PS, it will return the inactive topologies in the farm

Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$_.State -eq "Inactive"} |% {Remove-SPEnterpriseSearchTopology -Identity $_ -Confirm:$false}

If you are sure that you want to remove the inactive topologies, change the $false to $true and execute the PowerShell.

Till next time!!