Thursday, October 30, 2014

Delete All Site collections [/sites] from web application using powershell

1. The Get-SPDeletedSite cmdlet lists all the deleted site collections.

2. Restore a deleted site collection.

Get-SPDeletedSite | where{$_.SiteId -eq "4563-6b2e-473b-b6c3-e0967996aa7d"} | Restore-SPDeletedSite

3. Use the Remove-SPDeletedSite to permanently remove the deleted site collection.

4. Just permanent site collection delete , won't be available to restore in Recycle bin[careful as always]

Remove-SPSite "http://sharepoint.com/sites/test"

5.  NO permanent site collection delete , still available for restore in Content database Recycle bin.

Remove-SPSite -Identity "http://sharepoint.com/sites/test1" -GradualDelete

Note: Use the (2) command to restore the site collection.

Now, let me try for my actual need :

6.  Get the all site collections under the web application

Get-SPSite "http://sharepoint.com" -Limit ALL

Now, we try find the site collections under specific root ex: http://sharepoint.com/sites/ or  http://sharepoint.com/personal/

Get-SPSite http://sharepoint.com/personal* -Limit ALL

Now , we will remove all the site collections under the /personal/ root folder

a)  Permanent delete , won't be available to restore in recycle bin  or content database

Get-SPSite "http://sharepoint.com/personal*" -Limit ALL | Remove-SPSite -Confirm:$false 

b) No permanant delete, will prompt for each site , still available for restore in recycle bin

Get-SPSite "http://sharepoint.com/personal*" -Limit ALL | Remove-SPSite -GradualDelete


This is solve the my need , to delete site collections under /personal/ root level in Sharepoint portal.

Monday, August 25, 2014

SAP BO + Unable to reconnect to the CMS :6400 . The session has been logged off or has expired. (FWM 01002)

Today, We faced below error in our SAP BusinessObjects Business Intelligence,

Error: 'Unable to reconnect to CMS :6400. The session has been logged off or has expired.(FWM 01002)'


Solution: 1. From Central Configuration Manager, disable all the services and re-enable them (or ) Restart the SIA (Server Intelligence Agent)
(OR) 2. Log into Central Management Console and go to the server area.3. Go to the properties of Central Management Server, in command line parameters type -request timeout 3600000 (60 min).

Wednesday, July 23, 2014

SharePoint 2013 + Search Crawl new Feature + Continuous Crawl + search scopes

Tip of the Day..
Continuous Crawl is a new feature of SharePoint 2013 that crawls content as it is modified or added to the sites. This can be resource intensive on large SharePoint sites. Alternatively, crawls can be scheduled for specific time

One more Tip...
SharePoint 2007 and 2010 included the option to add scopes to a drop-down list next to search boxes in the sites. This would allow site administrators to create narrowed down search results for specific uses. For instance, a scope could be created to only return items from a specific library.

With SharePoint 2013, Microsoft has removed the concept of search scopes. Instead, we will need to create a new search results page with a limited search query.

SharePoint + Configuring "anonymous access" for web application + Restrict access to application pages

Configuring anonymous access at the SharePoint web application level can also be accomplished with PowerShell or code using the server-side object model.
Configuring anonymous access for web applications using PowerShell
  1. Get the SharePoint web application with the following Get-SPWebApplication Cmdlet:
2.  $webApp = Get-SPWebApplication http://SP:80
  1. Set the AllowAnonymous property for the IIS settings of the Default zone to true:
4.  $webApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].AllowAnonymous = $true
  1. Update the web application using the following command:
6.  $webApp.Update()
Configuring anonymous access for web applications with code using the server-side object model
Follow these steps to configure anonymous access for a web application with code using the server-side object model:
  1. Get the SharePoint web application by its URL:
var webApp = SPWebApplication.Lookup(new Uri("http://SP:80"));
  1. Set the AllowAnonymous property for the IIS settings of the Default zone to true:
webApp.IisSettings[SPUrlZone.Default].AllowAnonymous = true;
  1. Update the web application using the following line of code:
webApp.Update();
Limiting access to application pages
In previous versions of SharePoint, enabling anonymous access allowed users to access application pages such as the Site contents page. Preventing access to the application pages (/_layouts) previously required some manual configuration. In SharePoint 2013, access to application pages can be restricted using the new Limited-access user permission lockdown mode feature. In this recipe, we will activate this feature on our site collection.
How to do it…
Follow these steps to enable the site collection feature to limit access to application pages:
  1. Navigate to the site collection in your preferred web browser.
  2. Select Site settings from the Settings menu.
  3. Select Site collection features from the Site Collection Administration section.
  4. Activate the Limited-access user permission lockdown mode feature.


How it works…
With the Limited-access user permission lockdown mode feature enabled anonymous users will no longer be able to access pages within the /_layouts folder. This prevents these users from accessing pages such as the Site contents page and reduces the surface area for anonymous users to identify or exploit content in the site.

Using the Site contents page is one way hackers attempt to identify content on SharePoint sites in an attempt to exploit the site. Using this feature helps to eliminate that option for anonymous users.

Wednesday, July 9, 2014

SharePoint 2010 Approval Workflow-- use the "open this task" button is missing?

Issue: Today,  I'd run the OOTB approval workflow in SharePoint 2010 , I'd received the below task email to my outlook(2010) But when I try to click /open on the Open This Task Button, However I cannot locate that button for any user.






To complete this task:
  1. Review Test Ravi.
  2. Perform the specific activities required for this task.
  3. Use the Open this task button to mark the task as completed. (If you cannot update this task, you might not have access to it. Click here to request access.)

Reason:

The reason for this is because SharePoint 2010 assumes you have Outlook as your
mail client and the email that is sent out eludes to an Open this Task button
which in Outlook appears on the
OUTLOOK toolbar

Solution:

If you have outlook 2010 client installed , you can find the "Open this Task" button on Outlook Ribbon, but not is email. Please see the below pic.

SharePoint 2013 + "Entry point not found " error while opening the workflows in Visio

Error: Entry point not found (or) The Server failed to process the request when I tried to open the SharePoint 2013 workflows tasks status in Visio.





Solution: "Visio Graphics Service" was not running(Start it from Central Admin site -->Services on Server --> Find Visio Service), which was causing this problem. Starting the service resolved it.



Monday, July 7, 2014

Seattle Vs Oslo SharePoint 2013 Master Pages

Here is the info i'd collected so far...

When we compare them visually, the only difference is that oslo doesn't have left side navigation

In general, seattle is designed for intranet team collaboration with more features such as  social, content\site navigation and management shortcuts. 

While oslo master page is designed for published site which focus on page layout and content rendering.

The Oslo masterpage handles anonymous users differently as well. For instance, the top ribbon is completely removed for anonymous users, while Seattle keeps it. Check out more at http://davidlozzi.com/2013/09/25/theres-more-than-meets-the-eye-differences-between-sharepoints-oslo-and-seattle-master-pages/

Seattle is what we’re used to with SharePoint 2010: left nav and a top nav. Oslo moves the left nav to the top, and removes the top nav all together. Oslo also provides more room for your content by widening the area by moving the left nav.

  • Oslo uses a different CSS, obviously, oslo.css instead of corev15.css. Also, the CSS link has EnableCssTheming set to true, whereas Seattle doens’t state anything.
  • Oslo has several accessibility and animation links wrapped with a SPSecurityTrimmedControl, configured to hide the contents from the search crawler. Seattle just has the links listed, no security trimming.
  • Oslo has a AuthenticatedUserDiv tag wrapping almost all of the content on the page. This control “Renders a DIV element which has different styles based on whether the current user is authenticated or anonymous” (from MSDN article). This control is configured with an authenticated style set to a CSS class. So when an authenticated user accesses the site, it uses a CSS class, when it’s anonymous, no class is specified at all.
  • Oslo has several other areas and controls wrapped with SPSecurityTrimmedControl configured to restrict to authenticated users only.
  • Oslo has a couple of small areas where CSS class names differ.
  • There’s the obvious changes with the navigation and header, and previously noted.
  • The PlaceHolderTopNavBar content place holder is thrown at the bottom of the page, and is set to be hidden. So that’s where that went.
Seeing there are a lot of security trimming around authenticated vs anonymous, I decided to test that out to see what it looks like.
First, let’s see what Seattle looks like anonymously:
SharePoint Seattle Masterpage in Anonymous
Seattle Master Page as Anonymous
Interesting, the web parts are intelligent enough to know anonymous users can’t “get started” and the newsfeed is gone. Also, some of the ribbon items change. Nothing else too significant.
Next up, Oslo:
SharePoint Seattle Masterpage in Anonymous
Oslo Master Page as Anonymous
Whoa, that’s a lot more now isn’t it? We lost the ribbon completely, including the SharePoint blue bar at the top. It feels naked.
I compared the HTML output of the two sets of pages as well.
  • Seattle didn’t differ much, minor items, but nothing too specific to anonymous vs authenticated.
  • Oslo, huge differences, entire sections are missing. Those security trimmed sections I mentioned before, poof, gone.
It almost feels like Oslo was designed with anonymous access in mind, as in Microsoft wanted us to use Oslo for public facing sites, as it took care of so much for you already


Tuesday, July 1, 2014

SharePoint 2013 + The Taxonomy feature (Feature ID “73EF14B1-13A9-416b-A9B5-ECECA2B0604C”) has not been activated

If you are getting this error when try to add a custom column of the Managed  Metadata type to your site collection, use the following PowerShell command to activate this feature


Enable-SPFeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C -URL

Monday, June 30, 2014

SharePoint 2013 + Error loading navigation: The Managed Navigation term set is improperly attached to the site.

Error: Error loading navigation: The Managed Navigation term set is improperly attached to the site.

I got below error when I created terms and term sets In SharePoint 2013 site collection , also I'd  set to use Managed Metadata Term Set as a Site Navigation.  This will set the Metadata termset as site collection navigation by overriding the Default GLOBAL/Current navigation, So you will get below error.




















Solution:
  1. Go to Site Settings > Navigation
  2. Select the "Structural Navigation" for Global and Current navigations.

Wednesday, June 25, 2014

HTPP Error 500.19 "Protocol Mapping" While hosting a WCF service in IIS

When you create a WCF service with VS 2013.And when you try to browse the .svc file it gives you the following error:
"The configuration section 'protocolMapping' cannot be read because it is missing a section declaration"

Error Summary

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information
ModuleIIS Web Core
NotificationUnknown
HandlerNot yet determined
Error Code0x80070032
Config ErrorThe configuration section 'protocolMapping' cannot be read because it is missing a section declaration
Config File\\?\C:\inetpub\wwwroot\test\web.config
Requested URLhttp://localhost:11\test.svc
Physical Path
Logon MethodNot yet determined
Logon UserNot yet determined
Config Source
   25:     
26: 27:
Links and More Information This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error. View more information »


Solution: 
You need to ensure that the app Pool you are using for the IIS site is setup to use .net 4, because protocol mapping is only available in .net 4. By default it is set to V2.0

Hope this helps

Monday, June 23, 2014

"Script Editor Web Part" -- A new webpart in SharePoint 2013 for CMS for "Iframes"

Here is the good and new web part introduced in SharePoint 2013 for CMS developers, Especially when you want to deal with "iFrames" to display videos or images in SharePoint pages. Or you can share YouTube videos on your SharePoint site by just copying the iFrame link and past in script editor webpart.

First, you need to add the site domain in "HTML Field Security", then it will allow you to embed into content editor.   But this is not enough to support iFrames,  if you want to add iFrames, so here is new web part called Script Editor Web Part, this should address this .

See the below example for adding YouTube video or your own video which is embedded in iFrames and show in your SharePoint 2013 site.

1.Add Script Editor web part from the gallery to your SharePoint page.






  2. Open youtube video and click on Share, then click on Embed, you can see iFrame tag in the box., Copy the tag. 

    3. Click on Edit Snippet on the Script editor web part, Paste the tag code.


   4.  Click on Insert, that’s it , your video will be available for play.
 





Happy SharePointing...:)

Share your images, videos online

Hey Guys, here is a good tool I found, which is useful especially when you work remotely with your colleagues, customers, friends, Jing captures anything you see on your computer screen, as an image or short video, and lets you share it instantly. ... Simply select any window or region that you want to capture, mark up your screenshot with a text box

http://www.techsmith.com/download/jing/

You can share your images, videos thru https://www.screencast.com/account.aspx


Tuesday, June 17, 2014

How to clear SharePoint Designer "Cache"

I've been experiencing the strange issues with SharePoint designer, and I’m keep deleting website cache from local machine , Sometimes SharePoint Designer asks to check out files that are not checked in, refuses to check in , SPD misbehaves with the below error message:
"Cannot perform this operation. The file is no longer checked out or has been deleted."

(OR) if you working with SPD workflows, you see this issue regularly. For example when you update the workflows , you might missed to get the updated content some times, the root cause is SPD cache.
Simply put, SharePoint Designer is out of sync with SharePoint and you have to delete its cache in order to rebuild it. The cache is composed of these 2 folders:
 Areas to clear:
1. Open Run Command and copy the below paths.
%APPDATA%\Microsoft\Web Server Extensions\Cache
%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\

and, also you can do the below settings.. 
SharePoint Designer 2010 and 2013
  1. Navigate to the "File" menu then select "Options" -> "General" -> "Application Options".
  2. On the “General” tab, under the “General” heading, uncheck “Cache site data across SharePoint Designer sessions”.
 SharePoint Designer



I found the solutions in few blogs but I 'm keep forgetting paths, even though I’m doing this job from SPD 2007 times, so I thought I'd better document it myself in blog.

Friday, June 13, 2014

Web Part Connections SharePoint 2013

Below are the OOTB webparts in SharePoint 2013 which support webpart connections, The connections menu is only available if both web parts support a compatible connection type though.

SUPPORTED LIST TYPES
 - Announcements
 - Contacts
 - Events
 - Issues
 - Links
 - Tasks
 - Custom lists
 - Lists that contain data imported from a spreadsheet
 - Document libraries
 - Form libraries


UNSUPPORTED LIST TYPES
 - Calendar view of an Events list
 - Discussion boards
 - Surveys
 - Picture libraries
 - Site and list template catalogs
 - Web Part galleries
 - Data sources

Renaming the URL of an existing Document Library or List in SharePoint

Renaming/changing the URL of an existing Document Library or List in SharePoint is come across to every SharePoint professional,

Yes, It is possible to update the URL of an existing list or document library without coding using below TWO methods:
(1) Windows Explorer
Navigate to a document library in your site and open this document library in Windows Explorer, Navigate to the list (or document library) using the Windows Explorer. Select the folder representing the list and rename the folder. After you rename the folder and navigate the your site, only the URL will be updated and the list’s Name will remain unchanged.

(2) SharePoint Designer
Using SharePoint Designer you can update both Name and the URL of a list. To update the URL of a list navigate to All Files and rename the list. This rename only affects the URL of the list.

Renaming/changing the an existing Document Library or List  Name/Title in SharePoint is possible in Two ways:
(1) SharePoint User interface : You can rename title/name from UI.
(2) SharePoint Designer
Using SharePoint Designer you can update both Name and the URL of a list. To update the Name of a list navigate to Lists and Libraries and rename the list. This rename only affects the Name of the list.



Wednesday, June 11, 2014

OOTB Approval workflows missing in SharePoint 2013

Issue: If you find OOTB Workflows [ Approval, Collect Feedback ] missing on Workflow Settings for the SharePoint 2013 Library or List, you need to activate the workflow feature at site collection level.

Solution:
Browse to the site actions-> site settings-> site collection features

· Activate Workflows feature.



NoteThe out of the box workflows that ship with SharePoint 2013 are still SharePoint 2010-based workflows. Since SharePoint 2013 uses the Workflow Manager service, you must use SharePoint Designer to create 2013-based workflows. The out of the box approval workflow for 2013 is the same one that was used in 2010.

SharePoint Publishing Approval Workflow

If you would like to use Out of the box SharePoint Publishing Approval workflow for approving publishing the pages before to publish it for Read access users, Start this workflow to approve publishing a major version of an item option doesn't enabled by default. See below pic.


To enable this, you have to enable below two settings.
1. Require content approval for submitted items?
    YES
2. Create a version each time you edit a file in this document library?
   Create major and minor (draft) versions 

Note : Enabling Create major versions do not work though.


Now,  Start this workflow to approve publishing a major version of an item option will available.



Happy Workflows :)











Error in SharePoint 2013 : The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

Error: The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service.

Issue:
When I' trying to create a SharePoint 2010 Approval workflow in SharePoint 2013 site, I got this error.




Cause:
This is because the State Service Application is not configured in the server. State Service is a shared service that is used by some Microsoft SharePoint Server 2010 components to store temporary data information for InfoPath form services that includes both out of the box and custom workflow forms so state service is required for both out of the box and custom workflow forms.

Solution:
We need to configure State Service Application in the server. 

Method 1:
Open a SharePoint 2013 Management Powershell window and run the following command:

New-SPStateServiceDatabase -Name "State Service Database" | New-SPStateServiceApplication -“Name "State ServiceApplication" | New-SPStateServiceApplicationProxy -DefaultProxyGroup




Open Central Administration. Click on "Application Management". Click on "Manage Service Applications" that is available under the Service Applications section. You will be able to see the State Service application created successfully.

Share3.jpg

Method 2 : 
Run the Farm Configuration Wizard” in Central Admin, activate/tick the checkbox on "State Service" while running wizard.

Now the you create workflow and publish the workflow.