Tuesday, September 16, 2014

The option to 'Save library as template' is missing!!!

Option to save a library (eg: Site Pages) as a template is missing.

Not recommended, but if you have to, then...
Open the library, go to the "Document Library Settings" page.

The page's URL will read ".../listedit.aspx?List={GUID}". Now change the URL to "../savetmpl.aspx?List={GUID}" and voila! You can save the list/library as a template.

Friday, September 12, 2014

After restoring Site collection goes missing.

Its rare I listen to my instincts. I am famous for ignoring it. But today... desperate times humbled me enough to consider my instincts and that this what solved the issue.

I had been facing this issue since about 2 weeks (!!!! I know!).

Fresh installation of sharepoint. Only one site collection. A site collection back up that is around 23 GB is restored using STSADM's restore command. It takes 3-4 hours and executes with no hitches. User logs during the time of the restoration was 0KB. In Central Admin confirms its connected to the correct database. If you check the database size its about 21 GB that is in lines with the size of the back up file. But when you view the site, it gives 404- Webpage not found.

Tried a zillion things, finally what worked:
1) Detach Content DB
2) Attach Content DB

I did this through central admin: http://technet.microsoft.com/en-in/library/ff628582(v=office.15).aspx

I had felt like trying this a week ago, but logic did not allow me. But I had nothing to lose - I should have just tried it. Well anyway its a happy ending.

Wednesday, September 10, 2014

Sharepoint 2013 logs me in as Sharepoint\System account !!!!

PROBLEM: I was using a particular user account 'Domain\useracct' to remote into a Sharepoint server. However, upon opening Sharepoint Central Admin or any site, I would always be recognised as 'Sharepoint\system' user and it would not allow me to log in as another user (Domain\UserAcct). (This has been bothering me for weeks)

WHY: Apparently, the Sharepoint instance was using the same account for its application pools, (Central Admin-> Security->Configure Service Accounts) and if you log using the credentials used by the application pools, then you will be recognised as Sharepoint\System. You should never use any service accounts to interact with Sharepoint.

RESOLUTION: Go to Central Admin-> Security->Configure Service Accounts, change the service accounts being used, then you can happily log in using 'Domain\UserAcct' .

Tuesday, September 9, 2014

'Command line error' while using STSADM

On trying to execute this in my command prompt I got the 'Command line error' 

Stsadm –o restore –url <site URL>  –filename "<file path>" -overwrite

I had it typed out on notepad and copied and pasted it on the command prompt. This caused the problem.  WHY???? 
Well, surprise surprise... its because the encoding isnt compatible with the command prompt. The hyphen is causing a problem. Instead of UTF-8 it is ANSI. Why does it matter, beats me!

Whatever text editor you use, change it to UTF-8 and type out the command, copy and paste in to the command prompt. It will work. 


do what you didnt want to do in the first place -  type out straight into the command prompt. It will work for sure. :P

Sunday, September 7, 2014

Missing "Sign in as Different User" option in sharepoint 2013

Workaround : http://siteurl/_layouts/closeConnection.aspx?loginasanotheruser=true (works on some browsers)

Permanent Fix: 

1)  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\welcome.ascx

2) Put this code in welcome.ascx page

<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser" Text=" <%$Resources:wss,personalactions_loginasdifferentuser%>"  
MenuGroupId="100"   Sequence="100"   UseShortId="true"   />

Thursday, September 4, 2014

Remove and Uninstall a solution

PROBLEM: Once a solution has been added and deployed. Now, I would like to have it removed. But when i execute the install and remove command, I get this error:
The solution "xyz.wsp" has been deployed in the farm. Please retract the deployment before removing the solution.

To remove a solution you need to first uninstall it - and that will take a while, in the meantime if you execute the remove command you will get an error that would tell you to hold your horses (in boring robotic gibberish).

This script will do both in sequence and wait for the 'uninstalling' to finish before the 'remove' can execute.  

$s = get-spsolution -identity <WSP filename>.wsp 
uninstall-spsolution -identity <WSP filename>.wsp -confirm:$false

while($s.JobExists) { 
start-sleep -s 10 
remove-spsolution -identity <WSP filename>.wsp -confirm:$false

'The Windows PowerShell snap-in'Microsoft.SharePoint.PowerShell is not installed on this machine'

PROBLEM: I had reinstalled Sharepoint Foundation 2013 on win 2008 R2 SP1 and when I opened Sharepoint Management Shell and I got this error:

To install the dll, run this script in Powershell

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil /LogToConsole=true C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.PowerShell\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Powershell.dll