Thursday, July 5, 2012

Disabled Content Organizer - SharePoint 2010

If Content Organizer is enabled in your site, you will see a "Drop Off Library" document library either in your left Nav or when you are in All Site Content.


Disabled the feature in Site Settings does not remove the library. and you can't simply delete "Drop Off Library" because the "Delete this document library" link is not available when you are in the "Library Settings"... so how to delete this library?

Here is the PowerShell script that should save your day.

Powershell Script:

##=======================================================================================##
## PowerShell Disabled Content Organizer and delete "Drop Of Library" 
## Version: 1.0
## Last updated: 30 June, 2012
## Description: This script will loop through all the subsites in site collection 
##  and disable the Content Organizer Feature then remove the "Drop off Library"
## Reference: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/ff72703e-9ba0-4dc2-8221-ccda3529183d
##=======================================================================================##

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
 Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

Get-SPSite -Identity http://yoursitecollectionurl | Get-SPWeb -Limit ALL | ForEach-Object { 
  Disable-SPFeature –Identity DocumentRouting –url $_.Url –Confirm:$false
  $dropOffLibrary = $_.Lists["Drop Off Library"]
  $dropOffLibrary.AllowDeletion = "True"
  $dropOffLibrary.Update()
  $dropOffLibrary.Delete()
}

Hope this help!
Thanks

Wednesday, June 6, 2012

SharePoint new folder end with additional underscore

SharePoint has a logic to prevent user from using some of the reserved words as folder names (e.g._file, _files, .files).  So when you create a new folder with “_files” in the folder name in any document library, SharePoint will insert a “_” at the end.

For example, if your folder name is “Releases_files”, if you create this folder in any document library via browser or code, the result will be “Releases_files_”.

The work around is make sure there is no “_files” in your folder name, such as “files” or “-files” will work just fine. Apparently this “feature” has been around since MOSS 2007 or could be earlier, I did not know about it until this week, when one of our document migration code failed…

Found my answer through this link, http://objectmix.com/sharepoint/357916-appending-_-foldername-ending-_files.html

Thanks!

Monday, April 23, 2012

Could not find stored procedure ‘dbo.Search_GetRecentStats’, Event ID 5586 and 6398

In one of my new farm, I noticed two errors repeated themselves in the Event log every minute... One Critical (Event ID 6398), another Error (Event ID 5586), both complaint the same thing:
 "Could not find stored procedure ‘dbo.Search_GetRecentStats’"

Then I found my solution from Andrew Toh SharePoint Adventures Site - Event 6398 and 5586 SharePoint Foundation

Health Data Collection is not enabled. Do the following to enable this service.

  • Central Admin > Monitoring > Configure Usage and Health Data Collection.
  • On the page, make sure the "Enable Usage Data Collection" and " Enable Health Data Collection" are checked. 



If they are checked, make sure you reset them (uncheck them, click OK, come back the recheck them). Then your problem should be solved... 

Some time, I wonder if I could ever solve this issue without other help... because both errors do not mentioned or indicated anything about Health Data Collection... 
So Thanks Andrew! 

Friday, April 20, 2012

Start SharePoint Central Admin Service in Powershell

The other day, instead of reset (Stop and then Start again) the Business Data Connectivity Service in Services on Server page, I accidentally stop the Central Administration Service (well we are all human...) So I turned to PowerShell again...


List all SharePoint Services on the Server

Get-SPServiceInstance


To Start and Stop a SharePoont service you need

Start-SPServiceInstance [GUID] -Confirm


Stop-SPServiceInstance [GUID] -Confirm


Or You can pipe the Service Name to filter the Type Name and confirm your action.

Get-SPServiceInstance | Where-Object {$_.TypeName –eq ‘Central Administration’} |  Start-SPServiceInstance -Confirm


This should save a day :)

Thursday, April 12, 2012

Remove SharePoint Service Application Pool


Problem:
I have been monkeying with the Search Service Application for the last couple days. From create new, to delete, and then re-create new one again in a different name... Then I noticed, when I delete the Service Application, it does not delete the Service Application Pool that previously created or associated with it.

So the previous entries are still in the Service App Pool, and the Service App Pool list is getting longer. when I check the IIS, all I see lots of GUID entries in the Service App Pool... I am nervous of removing GUID in the Service App Pool from IIS without knowing the App Pool Name of the GUID.

Resolution:
Then I turned my search to PowerShell and found a proper solution to remove the Service Application Pool...

First list all the Service Applications with the following cmdlet 
Get-SPServiceApplicationPool | Select Id, Name

* You will need the Service App Pool Name when you are moving the Service App Pool in PowerShell, and the ID, when you remove the Service App Pool from IIS Manager.

Second, remove the Service Application in PowerShell
Remove-SPServiceApplicationPool

Example:


Finally, find the ID in IIS Manager Application Pool, and remove the guid entry from there, if there application associate with the app pool, IIS will stop you from removing the entry.

That's it... 
Note : This is not a problem in SharePoint, because the App Pool can be shared by other applications as well, so removal process will require additional care and love...


SharePoint 2010 Search Comparison

There were time I was asked to present the different version of Search in SharePoint, there tons comparison information in the web, but some of them breakdown too much for non technical / business user to consume, so I decided to simplify a version that is easy to read, also provide a link for more details only if user is interested.

A simplify comparison table of SharePoint Foundation Vs Standard Vs FAST


Features
SharePoint Foundation 2010
SharePoint Server 2010
FAST Search 2010 for SharePoint
Basic site search
Y
Y
Y
Visual Best Bets
Limited
Y
Search Scopes
Y
Y
Search Enhancement Based on User Context
Y
Crawl and Index Custom Properties
Y
Y
Property Extraction and Managed Properties
Limited
Y
Query Federation
Y
Y
Query Suggestions
Y
Y
Similar Results
Y
Sort Results on Managed Properties or Rank Profiles
Y
Relevancy Tuning by Document or Site Promotions
Limited
Y
Shallow Results Refinement
Y
Y
Deep Results Refinement
Y
Document Preview (Word, Excel, Powerpoint)
Y
Windows 7 Federation
Y
Y
People Search
Y
Y
Social Search
Y
Y
Taxonomy Integration
Y
Y
Multi-Tenant Hosting
Y
Rich Web Indexing Support
Y


From a more reliable source I found in TechNet - By Vedant Kulshreshtha
http://blogs.technet.com/b/vedant/archive/2009/10/23/search-technologies-for-sharepoint-2010-products.aspx

Thanks!

Tuesday, April 10, 2012

Configure Search in your Non Domain Standalone DEV Machine


If your SharePoint DEV environment is a non domain on a single machine (or a VM) like the one described in  my post about SharePoint 2010 standard/enterprise with SQL 2008 R2 on a single machine (standalone);

Your SharePoint Search in this DEV is likely not working, then I found a great post from Søren Nielsen, he created a very neat script that setup the Enterprise Search in your DEV environment "automagically"!

Follow the "Search Fix" section, you will find the handy script, and it work like a charm!

How to install a SharePoint 2010 Complete (Dev) Server without AD - By Søren Nielsen

Also check out
How to install and configure a standalone Sharepoint 2010 Server By Srikanth Nair

Many thanks to both Søren Nielsen and Srikanth Nair for Sharing the knowledge!

Deployment for SharePoint Server 2010

Found a series of SharePoint 2010 deployment option with instruction from Technet, those are common topic from SharePoint Administrators

Deployment and Installation
Search Configuration
Technet Complete Reference
http://technet.microsoft.com/en-US/sharepoint/ee518643

Monday, January 23, 2012

SharePoint 2010 Post SP1 - DB Restore - The backup file should be restored to a server with version '4.0.145.0'

We applied SP2010 SP1 in both production and development environments between Christmas and New Year break, the SP1 ran very smooth, it took care of everything auto-magically... after that we ran the SharePoint 2010 Products Configuration Wizard in both farm, and things seem perfectly fine, the backup still working fine, I did not pay much attention to it since...

Problem
But last week, I  tried to restore a content database using powershell in one of development environment by executing the following cmdlet :
Restore-SPSite -Identity http://SP2010-DEV -Path E:\Backups\Site-80\SP2010.Bak -Force

Then I got a content database version error.

"Restore-SPSite : Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '4.0.145.0' or later.
At line:1 char:15"

I was pretty sure we had the same patch to both DEV and PROD farms, I also went through exercise of comparing each services version installed in both environments, everything seem the same, but restore failed...

I followed number of suggestions that work for other (listed below), but it was no luck for my case...
Here were failed attempts (but works for others - may be you)

First attempted (Failed for me but might work for you)Upgrade-SPContentDatabase Method

  • Executed the Get-SPContentDatabase, to retrieve the database ID 
  • Then run the Upgrade-SPContentDatabase -Identity (database ID)
  • Later tried the Backup-SPSite and Restore-SPSite cmdlet...
But, during the restore I received the same error message

Second attempted (Failed for me but might work for you) - Use the old STSADM command for backup and restore.
  • STSADM.EXE -o backup -url http://server/site -filename backup.dat
  • STSADM.EXE -o restore -url http://server/site -filename backup.dat -overwrite
But, during the restore I still received the same error message

Third attempted (Failed for me but might work for you) - Restore back to the PROD at different web application
  • Restored the fresh backup from the PROD and restore back to the same server but in a different web application and port, using the Backup-SPSite and Restore-SPSite. 
But during restore I still received the same error message again! Holy moly, my heart sank!... I could not restore the same backup that I just created on the same environment!? it was complaining version different in the same prod farm...

So what is this haunting message "The backup file should be restored to a server with version '4.0.145.0' or later."!!??

After further searching again... I realized the problem is on the PROD farm, it is still out of sync... The SharePoint 2010 Products Configuration Wizard in the Central Admin did not correct the version issue... Using the (get-spserver $env:computername).NeedsUpgrade cmdlet it still returned "True".

Last attempted (Works for me!)
Than I found this technet article Restore pre-SP1 backups to an SP1 farm I need to run the following command on the production (SOURCE farm)

psconfig -cmd upgrade -inplace b2b -wait -force

The command completed successfully,

Then I re-checked the system again(get-spserver $env:computername).NeedsUpgrade cmdlet, this time it returned "False". I tried the same cmdlet in both PROD and DEV... After that, I re-created new backup again and was able to restore the backup in the development environment successfully.

This is rather uncommon situation, or may be I trusted the SharePoint 2010 Products Configuration Wizard in the Central Admin will do the job, But it did not... so I lost a weekend on this issue... but I am glad the psconfig cmdlet finally straight everything up. If you are parceling with same issue, hopefully this article may help you...

Good luck!

Some suggested the following cmdlet will work too, I have not tried it yet,
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Monday, January 9, 2012

SharePoint 2010 Application Event ID 8031


Just few days ago, I posted Remove Search Service Application in SharePoint 2010 using stsadm, over the weekend; I noticed my Application Event log is filled with SharePoint Foundation Error - Event ID 8031, it shows up every 15 minutes… with a big question mark, I turned to internet search engine; some suggested apply the October Cumulative updates for SharePoint 2010 which we already did last year, other suggest rebuild the SharePoint! OMG!

Since everything in the SharePoint appear to be running fine... There is no compelling reason for a server rebuild. Then I found this article from Von Ingo. it helps me get rid of this event. However, I had to arm-wrestling with the DBA to gain access to the SQL Server.

Basically, here is the summary of what you need to do.
  1. Copy the long ID from  the event log
  2. Search the ID in SharePoint Config DB
  3. Retrieve the Column ID
  4. Then run stsadm -o deleteconfigurationobject command
  5. Done!
Here are the details
  1. Copy the long ID from the event 8031, just like the blue highlight in the image above
  2. Logon to SQL Server and lunch SQL Management Studio 
  3. Navigate to SharePoint_Config database, create a new SQL Query, and enter the following statement
    • SELECT ID, Properties FROM [Objects] WHERE [Name] LIKE '%24ca5db5-9a2f-4a3d-9e52-38ab5a1a7ab0_735388cb-9769-4d37-b212-0b17a5db02f8%'
  4. Note the id was copied from the screen above.
  5. The query result returned with one record found. (screen below) 
    • Feel free to look into the XML contents if you are interested.
  6. Then I copy the column id from the above image (highlighted in purple)
  7. Go back to the Web server and run the following stsadm.
    • STSADM -o deleteconfigurationobject -id C8D9F11F-D129-41D7-9248-D54DE43059D2
  8. The operation completed successfully, 
You should stop receiving the Event ID 8031 every 15 minutes. You pretty much need to repeat this work every time after you remove a SharePoint Search Application from your farm.

Hope this help!

Updated 31st Oct 2012
* As pointed out by my reader, "Accessing the Config DB directly from SQL is not supported by Microsoft". Perhaps you should check with Microsoft Support before you update the Config DB manually.