Tag Archive for: Powershell

SharePoint 2013 CU August 2013 – “Internet Information Services not installed”

24 Feb
February 24, 2014

Today it was time to update my SharePoint 2013 installation from March PU 2013 to August 2013 CU – mostly because the Search Schema changed under the hood and I wanted to try something out for the awesome Search Query Tool.

Download

Wow, 1.8GB patch – that is huge! Compared to the RTM version of SharePoint 2013 with 2.4GB they rewrote 75% – or the patching strategy is not that optimal.

MSDN Subscriber Downloads_2014-02-21_15-36-30

Its time for a new baseline so patches can be smaller again. Lets see what happens after the SPC.

You can grab the SharePoint 2013 CU August 2013 patch here: http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2817616&kbln=en-us

KB Details here: http://support.microsoft.com/kb/2817616

Patch notes of Todd Klindt (my inofficial SharePoint patch guru) are here (and no regression reported): http://www.toddklindt.com/blog/Regressions/SP2013Aug13.aspx

Patching

For the patching part I always take the script from the article

“Why SharePoint 2013 Cumulative Update takes 5 hours to install?” – if you have not read it, go for it. This time something went bad, maybe because I started the script from ISE or something like that – it could not start the patch process so I did it myself. Took around 30 Minutes on my DEV VM – reboot and we should be ready, right?

“Internet Information Service not installed”

After the patching you have to start the Config Wizard. I was a little surprised as it responds with a nice error –  I even tried the PowerShell command in case there is a difference, but no:

Terminals 3.4.0 (Files store)_2014-02-21_15-12-49

What? IIS not installed anymore? Something must be broken with the Patch – let’s blame Todd for it:

But then I tried to reproduce my steps – of course it must be an user error. After reading the patch script (reading things sometimes helps), I noticed that the script disables the IIS Admin service…

Terminals 3.4.0 (Files store)_2014-02-21_15-31-32

SharePoint does not like that – set it back to Automatic start and start the service.

Starting the site is a good idea, too:

_2014-02-21_16-11-08

And then start the config wizard again:

_2014-02-21_16-11-45

And wait until every database is updated:

Terminals 3.4.0 (Files store)_2014-02-21_16-15-49

Search “Paused for:External request”

Then I tried do do a Search – without a success. I went to the Search Service Application page and saw the status: “Paused for:External request” – that means something paused the Service Application (maybe, just maybe someone tried to patch):

Terminals 3.4.0 (Files store)_2014-02-21_16-28-37

and we should resume it – 3 lines of PowerShell:

Lessons learned

Patching can be tough – but when you protocol what you do or can at least reproduce what you have done its pretty much straight forward. I do not blame the patch script here, I obviously did something wrong – but the error message is really misleading isn’t it?

Powershell: Enable Refiner Count for SharePoint 2013 Search Results

23 May
May 23, 2013

The refiner count is a very useful indicator in the Search Center whether the click on the refinement is worth it or nor – and the implementation is so intuitive that even end-users understands it. But: It is disabled by default in SharePoint 2013. This post shows you how to enable the Refiner Count for SharePoint 2013 – manually and with PowerShell.

Refiner Count in SharePoint 2010

The refiner count was introduced in SharePoint 2010 and is a FAST for SharePoint feature. If you don’t have FAST installed and enabled the Refiner Count, the count is estimated roughly with the first 50 results because SharePoint Search was not capable of deep refinement.

Deep refinement is based on the aggregation of managed property statistics for all of the results of a search query. The indexer creates aggregation data that is used in the query matching process. The advantage of using this kind of query refinement is that the refinement options reflect all the items matching a query.

Query Refinement (FAST Search Server 2010 for SharePoint)

In other words, the refiner count could change after you click on a refiner which is very confusing for end-users.

If you have FAST for SharePoint installed the refiner count worked flawlessly but had to be enabled with a xml modification in the refiner webpart.

image

Refiner Count in SharePoint 2010 + FAST for SharePoint 2010

Refiner Count for SharePoint 2013

The refiner count is still possible with SharePoint 2013 – the concept is not new but the implementation has changed. And as already mentioned, the count is disabled by default:

Refiner Count for SharePoint 2013 not visible

Refiner count not visible (default)

As you might know, you can change the rendering/design of elements with Display Templates in SharePoint 2013, most importantly for search results – this also applies to refiners – which is great if you ask me. Basically all you have to do is change the Display Template for the Refiner Filter which is a html file and you are good to go.

The file is located in the site collections MasterPage gallery folder, /_catalogs/masterpage/Display Templates/Filters/Filter_Default.html and contains the definition for the refinement item.

If you open the file you can see in the very first lines of the file you can see those lines:

Change the lines (replace the false with the true in line 2) to:

And voila, the refiner count is visible:

Refiner Count for SharePoint 2013 visible

Refiner count for SharePoint 2013

PowerShell approach:

You have to do it more than once? Automate it!

Here is my short PowerShell script which automates the step above:

 

Usage:

Just download this script and call it with the –siteUrl parameter to enable the Refiner count for the specified Site Collection:

or add -hide to hide the refiner count again:

Enable the Refiner Count for SharePoint 2013 - automated with PowerShell

Enabling/Disabling the refiner count made easy!

Pretty easy, isn’t it?

Powershell: Efficiently empty large SharePoint lists

03 May
May 3, 2013

Previously I had a little console app to efficiently empty large SharePoint lists. Today I converted it to powershell.

Compared to the simple item by item delete with item.Delete() its 30 times faster; on my dev machine it deletes ~30 items per second. It works for SharePoint 2010 and should  for 2013 (not tested, yet).

Script

Usage

Delete-Items.ps1 -weburl [url of web] -listname [name of list]

Further improvements

I think if the list is really huge (100k items or greater) the items should be deleted in batches.

I have not tried it with a document library, maybe there are issues. If there are issues, please leave a comment!

Disclaimer

There is no way back – if you start the script there is no “ARE YOU SURE?” – all data is gone in a very short time.

Cache cluster is down, restart the cache cluster and Retry

05 Feb
February 5, 2013

Had a small issue with my SharePoint 2013 MySite today, I could not update a User Profile in Central Admin – this is what I got from the ULS Log:

sp2013_cachecluster

ULSViewer: The exception is pointing us in the right direction.

The Execute method of job definition Microsoft.Office.Server.UserProfiles.LMTRepopulationJob (ID 104963a2-b53c-4476-bc23-fa7d6453e42f) threw an exception. More information is included below.  Unexpected exception in FeedCacheService.IsRepopulationNeeded: Cache cluster is down, restart the cache cluster and Retry.

At least the error message pointed me to the right direction, the Cache Cluster is new in SharePoint 2013 and I associated it with the app fabric distributed cache. As I first read it it sounded like “The King is dead – long live the King!” – but maybe I watch to many movies…

Solution

Restart the app fabric service and wait a couple of second with a line of powershell:

SharePoint 2013: Replace the PDF icon

18 Sep
September 18, 2012

Icon madness

Playing arround with SharePoint 2013 and uploading some content for a cool search driven application I noticed that the PDF icon is not the correct one:

MS_PDF_ICON

OOTB PDF icon from SharePoint 2013

Is it a document with a belt or what ? Nevermind I don’t like it and I am very certain that most of the users out there do not recognize the icon – and that is the main purpose of the icon right?

Search_WithMSPDF

Search result with out-of-the-box SharePoint 2013 PDF icon

With SharePoint 2010 there was no PDF support out of the box – afaik there was no icon at all. I should be happy and quite right? Nope, created a small powershell that replaced the icon (either you place it next to the script or the script downloads it from the Adobe page).

The result will look like this – way better if you ask me.

Search_WithOriginalPDF

Original PDF icon – as expected!

PDF_Doclib

Same icon in a document library

 

Powershell to the rescue – once again!

And here comes the small script:

 

Thats it – go try it!

As always, would love to hear your feedback.

#SharePoint 2013 – Create a Search Service Application and Search Topology with Powershell

23 Jul
July 23, 2012

Writing SharePoint 2013 feels very new to me, but I created my first Demo environment and tried to set up search.

What needs to be done?

14 steps for a simple Search Topology – 1 powershell can do them all.

  1. Create a Service Application Pool for the Search Service Application (15-22)
  2. Create a Search Service Application (22-28)
  3. Create a Search Service Application Proxy (30-36)
  4. Get the current Search Instance (38)
  5. Save the current Search Topology for later use (39)
  6. Create a new Search Topology (40)
  7. Create all the Search Components (Analytics- , Content Processing, Query Processing, Crawler-, Admin Component) (42-46)
  8. Remove the Index-Folder and recreate it (50-51)
  9. Create a new Index Component (53)
  10. Activate the new Topology (56)
  11. Call the method synchronize on the old topology – this errors but forces an update on the old topology object (59)
  12. The "forced updated" Topology object becomes inactive and can be deleted. (62)
  13. Everything  done – start a full crawl oder set it to the new shiny continuous crawling. Enjoy!

The numbers in the braces are the line numbers in the powershell script following now.

 

Powershell to the rescue!

Here is my powershell script for creating the whole service application and creating a basic topology.

Please keep in mind that the $IndexLocation folder will be deleted and recreated.

Adjust the settings in the lines 4-11 to your needs.

The whole script took about 3 minutes on my machine.

image

 

References

I took some parts from here, but received some errors, some paramaters were missing so I adjusted the script for my needs.

The MSDN documentation is missing that there is a timer job responsible for topology changes – ULSViewer helped me to figure that one out.

Update 1, 24.07.2012 17:11

I exchanged some emails with Alpesh Nakar (funnily he created a script for the same thing) and he helped me reducing my script a lot. Thanks for that.

 

Did it work for you?

Missing FAST Search Center Template

26 Apr
April 26, 2012

Ever wondered where the FAST Search Center Template is and why the hack its not there when you create a new site?

Start this little powershell and you can create it: