Clean up – Search Service Application in SharePoint 2013

Well you faced something went wrong and looks that you could not able to delete search service Application correctly. In this article’s purpose  demonstrate which components we have using for a Search Service Application

Ok Lets break our Search Service Application .Well don’t try this on a production 🙂 I assume that you have a completely running Search Service Application and will break it to test purpose
Open a sharepoint powershell console and type

$SSA = Get-SPEnterpriseSearchServiceApplication
(if you have more than one SSA you need to change parameters to get the correct one)
CleanSSA1

So lets create a scenario that someone we assume has deleted our good SSA like

$SSA.Delete()

CleanSSA2

+Upps In this condition you have a big problem. Because deleting the object of the service app itself is not a correct action . It clears the Service Application Object but Search Service Application have many other components (IIS Web Service,Timer Jobs ,DBs etc)  and they are still remains. Unfortunately there is no warning when you did it.
If you really want to remove a Service Application , you have to use Remove-SPServiceApplication cmdlet, not call the related object’s delete method.

So define what is remaining we have to know what components are we installing when you provision a Search Service Application

-We have creating a IIS Web Site under SharePoint Web Services Site.
-We have creating 8 Timer jobs for every SSA.

  • “Search Custom Dictionaries Update for Search Application <guid of SSA>”
  • “Crawl Log Cleanup for Search Application <guid of SSA>”
  • “Rebalance crawl store partitions for <guid of SSA>”
  • “Usage Analytics Timer Job for Search Application <guid of SSA>”
  • “Spelling Customizations Upgrade for Search Application <guid of SSA>”
  • “Spelling Dictionary Update for Search Application <guid of SSA>”
  • “Analytics Timer Job for Search Service Application <guid of SSA>”
  • “Query Classification Dictionary Update for Search Application <guid of SSA>”

-In a usual way we have creating a Search Service Application Proxy
-And that Proxy consumed by several Web Applications .
-And a Search Administration Web Service (We are using this for Crawl operation, Crawl component is not a FAST Search related part and not runs under noderunner.exe process .

Actions:
Well the supported action for this scenario is return from Backup by Microsoft!
But if you want to get a clean state on a test env you may try this;

1) Remove the Search Service DB’s
CleanSSA3
2) Open IIS and find Search Service Related web sites under SharePoint Web Services , locate and delete only the related search service site.
CleanSSA6
3) Clean up all SSA Connections on Web Application level.
-Open the Central Administration -> Manage Web Application -> Select Web Application -> Click to Service Connections on the ribbon
CleanSSA5
4) Remove if SSA Proxy still available
CleanSSA4
5) Remove Search Administration Web Service Application if exists

6) Clear the timer jobs belong to deleted SSA .(Otherwise they will make a log noise with critical exceptions )
(I accept this can create some concequences and you may not able to delete some remaining timer-jobs very easily in some scenarios but at least you can disable them.)
Well totally clear it , you may need to open a case to Microsoft.

Even so there are many objects still remains in SharePoint_Config database. Directly deleting from database is an unsupported operation!

 

How to collect IIS Logs for a SharePoint Web Application

Hello All,

When working with Microsoft Support for some cases the support engineers ( like me ) may request IIS Logs for investigation.
So in this article i am going to tell how you can collect IIS Logs correctly.

1) You have to detect your IIS Web site on IIS Console because your site url and your web application name can be different.
First connect your Central Administration and click “Managed Web Application”‘s link .

but my Web Application Name is SharePoint – 8080

2) Open your IIS Manager and find and click your webapplication name

3) Click the “Advanced Settings” in Action pane.

4) Please not your IISsite ID for this example is 1442344892

5) Click “Logging” icon

6) Detect where the IIS logs are kept in which folder

7) Open this folder in Windows Explorer and find your related folder in it according your IISSite ID. In this scenario the folder is W3SVC1442344892
You can open windows explorer by “Start” -> “Run” and copy paste highlighted path on above screenshot and press enter.

8) Open that folder and order by “Modified Date” as descending order

9) Collect your files according to occurrance time of your problem or issue. If you have a workspace opened by Microsoft and your file size are big , you can compress the files with a compression program.

Notes: IIS buffers the logs in memory for a while before write to the log file (until log buffer chuck size has reached its max size). If you want to catch latest records you may need to do an iisreset or open a command prompt and type  “netsh http flush logbuffer” (this command will provide http.sys to flush logs.)
to force iis write cached log chunk to log file. If you are searching for old records that “Modifed Date” earlier than last log date you dont need this operation.

Have a nice log hunting 🙂

Sharepoint 2010 – Basic Authentication and Php .net web service connection.

A few days ago i have faced a problem that an application which coded with php try to connect sharepoint web services. And it didnt not succeed because of authentication of sharepoint system was windows authentication. PHP application support basic authentication so sharepoint does also. But the problem is when change authentication to basic or enable basic authenticaition for production site cause a security risk . So  SSL should be use but in our case it is one of out of issue.

so what we did , extending current site to new web application from Central Administration and enable basic authentication for extended site. Secure this extended site for specific application server that running php via Firewall rules and voila . Also suggested for external connection for this site using vpn or also able to use ssl if they able to change their code for it.

For Enabling Basic Authentication fallowing defined above senario :

1)  Extend your sharepoint site from Central Administration .

2) Enable basic authentication from IIS management console for extend web application. 

3) Select Authentication Provider for your newly extended site.

4) Enable Basic Authentication from configuration.

 

its done 🙂