Find All InfoPath Form Libraries and lists in SharePoint


As part of the cleanup activity one of the SharePoint analyst requested a report listing all the forms libraries and lists as well with document count and last modified date. Finding lists with forms enabled was different used SharePoint manager to search and query for the property which separates lists with and without forms but no luck.

Then I found the following property from one of the blog and married up the script with Rajack’s script to produce a script works for me.

 

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
 
#Get the web application
Write-Host "Enter the Web Application URL:"
$WebAppURL= Read-Host
$SiteColletion = Get-SPSite($WebAppURL)
$WebApp = $SiteColletion.WebApplication
 
#Write the CSV header
"Site Collection `t Site `t List Name `t List Url `t Docs Count `t Last Modified `t Form Template" > InfoPathLibs.csv
 
#Loop through all site collections of the web app
    foreach ($site in $WebApp.Sites)
    {
       # get the collection of webs
       foreach($web in $site.AllWebs)
        {
            write-host "Scaning Site" $web.title "@" $web.URL
               foreach($list in $web.lists)
               {
                   if( $list.BaseType -eq "DocumentLibrary" -and $list.BaseTemplate -eq "XMLForm")
                    {
                    $listModDate = $list.LastItemModifiedDate.ToShortDateString()
                    $listTemplate = $list.ServerRelativeDocumentTemplateUrl
                    
       #Write data to CSV File
                   $site.RootWeb.Title +"`t" + $web.Title +"`t" + $list.title +"`t" + $Web.Url + "/" + $List.RootFolder.Url  +"`t" + $list.ItemCount +"`t" + $listModDate +"`t"  + $listTemplate >> InfoPathLibs.csv
                }
                elseif ($list.ContentTypes[0].ResourceFolder.Properties["_ipfs_infopathenabled"])
                {
                    $listModDate = $list.LastItemModifiedDate.ToShortDateString()
                    $listTemplate = $list.ServerRelativeDocumentTemplateUrl
                    #Write data to CSV File
                   $site.RootWeb.Title +"`t" + $web.Title +"`t" + $list.title +"`t" + $Web.Url + "/" + $List.RootFolder.Url  +"`t" + $list.ItemCount +"`t" + $listModDate +"`t"  + $listTemplate >> InfoPathLibs.csv
                }
             
               }
        }
    }
 
#Dispose of the site object
$siteColletion.Dispose()
Write-host  "Report Generated at same path of the powershell script InfoPathLibs.csv" -foregroundcolor green

The following report looks like:

In the below report which ever list does not have a form template implies its a list and all others are document libraries.

report

 

Advertisement

SharePoint infamous direct URL’s


Force Page Edit Mode in SharePoint: http://host/sitecollection/page.aspx?ToolPaneView=2&pagemode=edit
Sign in as Different User:  http://host/sitecollection/_layouts/closeConnection.aspx?loginasanotheruser=true
Important: This option uses an unsupported browser feature which is unreliable and causes other issues. Currently this option does not work in IE 10 and Safari.
Web Part Maintenance Page:  HTTP://host/sitecollection/page.aspx ?contents=1
Show Page in Dialog View: HTTP://host/sitecollection/page.aspx?isdlg=1
Site Features: _layouts/ManageFeatures.aspx
SiteCollection Features: _layouts/ManageFeatures.aspx?Scope=Site
(the query string parameter is case sensitive. “Scope=site” throws an error)
Get the version of the SharePoint server (Patch level): /_vti_pvt/Service.cnf
Application page for registering SharePoint apps: /_layouts/15/appregnew.aspx
Save Site as a template:  /_layouts/savetmpl.aspx
Sign in as a different user: /_layouts/closeConnection.aspx?loginasanotheruser=true
Enable SharePoint designer:  /_layouts/SharePointDesignerSettings.aspx
Welcome Page (Default page settings): /_layouts/AreaWelcomePage.aspx
Change Site Master Page:  /_layouts/ChangeSiteMasterPage.aspx
Page Layouts and Site Templates: /_Layouts/AreaTemplateSettings.aspx
Master Pages library: /_catalogs/masterpage/Forms/AllItems.aspx
User Information List: _catalogs/users/simple.aspx
Quick Deploy List: Quick%20Deploy%20Items/AllItems.aspx
Open Page in Edit Mode:  ?ToolPaneView=2
Taxonomy Hidden List (MMS): Lists/TaxonomyHiddenList/AllItems.aspx
User Information List:  _catalogs/users/simple.aspx
Force displaying the user profile in the site collection:  /_layouts/userdisp.aspx?id={UserID}&Force=True
Note: Some URL’s I have not tested though.

SharePoint 2013 – Configure Access services On-Premise Installation


Hello Folks, I found the following documents and articles very helpful in setting up Access Services on SP 2013 On-Premise Installation

Links:

  1. http://blogs.msdn.com/b/kaevans/archive/2013/07/14/access-services-2013-setup-for-an-on-premises-installation.aspx
  2. http://www.microsoft.com/en-in/download/details.aspx?id=30445

Between, We need to configure “apps for SharePoint” for Access service to work. Below are the some helpful links:

  1. http://technet.microsoft.com/en-us/library/fp161236(v=office.15)
  2. https://www.nothingbutsharepoint.com/sites/devwiki/articles/pages/configure-an-environment-for-apps-for-sharepoint-2013.aspx
  3. http://sharepoint-community.net/profiles/blogs/configure-an-environment-for-apps-for-sharepoint-sharepoint-2013

Hope this helps..:)

Flush BLOB cache in SharePoint


To flush the BLOB cache from web application

  1. Open a SharePoint Management Shell or ISE
  2. Copy the following code and paste it into a text editor, such as Notepad
  3. $webApp = Get-SPWebApplication "<WebApplicationURL>"
    [Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
    Write-Host "Flushed the BLOB cache for:" $webApp
    
  4. Replace <WebApplicationURL> with the URL of the Web application whose BLOB cache you want to clear.
  5. Save the file, and name it FlushBLOBCache.ps1.

 

To flush the BLOB cache from ALL web application

           $wa = get-spwebapplicaton
           foreach($wapp in $wa)
            {
            [Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($wapp)
            Write-Host "Flushed the BLOB cache for:" $wapp
            }

Distributed Cache errors in the ULS log


Summary

We noticed a ton of Distributed Cache errors in the ULS log. There were actually 3,670 of the errors below within 30min;

Issue

Out of the box, AppFabric 1.1 contains a bug with garbage collection. AppFabric 1.1 is a prerequisite for SharePoint 2013 as it is the underlying technology used by the Distributed Cache service.

Affects

SharePoint Server 2013 + March Public Update

Symptoms

Due to the bug, some requests to Distributed Cache time out. In our case, users authenticated to a SharePoint using formed based authentication were unexpectedly logged out of the site because the check for their logon token timed out. As well, requests from the search cache timed out after three seconds increasing the time to load search results.

A review of the ULS logs showed a number of distributed cache exceptions :

Unexpected error occurred in method ‘GetObject’ , usage ‘SPViewStateCache’ – Exception ‘Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:The request timed out.. Additional Information : The client was trying to communicate with the server : net.tcp://contoso.com:22233 at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, RequestBody reqBody) at Microsoft.ApplicationServer.Caching.DataCache.InternalGet(String key, DataCacheItemVersion& version, String region, IMonitoringListener listener) at Microsoft.ApplicationServer.Caching.DataCache.<>c_DisplayClass49.b_48() at Microsoft.SharePoint.DistributedCaching.SPDistributedCache.GetObject(String key)’. e7a6759c-378f-40e7-26a8-be00a48fcde1

Token Cache: Failed to get token from distributed cache for ‘0#.f|provider|username’.(This is expected during the process warm up or if data cache Initialization is getting done by some other thread).
Exception: ‘Microsoft.SharePoint.DistributedCaching.SPDistributedCacheClientRequestTimeOutException: Communications with the cache cluster has experienced a delay past the timeout value,please increase the RequestTimeout of the client. —> Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:The request timed out..
Additional Information : The client was trying to communicate with the server : net.tcp://contoso.com:22233
at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, RequestBody reqBody)
at Microsoft.ApplicationServer.Caching.DataCache.InternalGet(String key, DataCacheItemVersion& version, String region, IMonitoringListener listener)
at Microsoft.ApplicationServer.Caching.DataCache.<>c__DisplayClass49.b__48()
at Microsoft.SharePoint.DistributedCaching.SPDistributedCache.GetObject(String key) –
— End of inner exception stack trace —
at Microsoft.SharePoint.DistributedCaching.SPDistributedCache.GetObject(String key)
at Microsoft.SharePoint.IdentityModel.SPDistributedSecurityTokenCache.GetObject(String key)
at Microsoft.SharePoint.IdentityModel.SPTokenCache.TryGetCachedToken(String cacheKey)’.

Unexpected error occurred in method ‘GetObject’ , usage ‘Distributed Logon Token Cache’ – Exception ‘Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.).
Additional Information : The client was trying to communicate with the server :

DistributedSearchResultsCache::Get() – Failed due to exception = ‘Microsoft.Office.Server.DistributedCaching.SPDistributedCacheClusterDownException: Cache cluster is down, restart the cache cluster and Retry —> Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.).
Additional Information : The client was trying to communicate with the server

Resolution
  1. Apply AppFabric Cumulative Update 3AppFabric Cumulative Update 4, or a later AppFabric CU to all servers in the farm
  2. Add backgroundGC key to DistributedCacheService.exe.config file on all cache servers
  3. Restart AppFabric Windows Service on all cache servers
  4. Restart Distributed Cache SharePoint service on all cache servers
  5. Reset IIS (IISRESET) on all servers in the farm

If the issue persists, you may need to increase timeout and connection values:

  1. Increase distributed cache client settings for affected containers using the Set-SPDistributedCacheClientSetting cmdlet.
  2. Increase security token service values with Get-SPSecurityTokenServiceConfig
  3. Restart AppFabric, and Distributed Cache on cache servers

 

References:

https://www.habaneroconsulting.com/insights/SharePoint-2013-Distributed-Cache-Bug

http://support.microsoft.com/kb/2800726/en-us

http://msdn.microsoft.com/en-us/library/hh351248(v=azure.10).aspx

SharePoint 2013 Search Center URL update in All Site Collections


When we plan to use a new search center in SharePoint 2013 for a web application, the question arises how to update the site collections with this new Search Center URL and PowerShell seemed the best option and while iterating through all the site collections to update Search Center URL. Make sure the search settings under subsites/webs “Use the same results page setting as my parent” is checked. Then updating the search center url at Site Collection level should work for all the sub sites.

$SPWebApp = Get-SPWebApplication http://webapp.com
foreach ($SPSite in $SPWebApp.Sites)
{
if ($SPSite -ne $null)
{
$web = Get-SPWeb $spsite.Url
$web.AllProperties[“SRCH_SB_SET_SITE”] =  ‘{“Inherit”:false,”ResultsPageAddress”:”/sites/SearchCenter/Pages/results.aspx”,”ShowNavigation”:false}’
$web.AllProperties[“SRCH_ENH_FTR_URL_SITE”] = ‘/sites/SearchCenter/Pages’
$web.Update();
}
}

In the above code make sure you update the full url of the search center if the web app is different for the search center other wise relative path should work.

Reference:

http://stevemannspath.blogspot.in/2013/07/sharepoint-2013-search-setting-all.html

http://radutut.wordpress.com/2013/03/11/update-search-settings-using-powershell-in-sharepoint-2013

http://jshidell.com/2013/01/16/setting-sharepoint-2010-site-collection-search-settings-using-powershell

http://sharepoint.jsturges.com/2012/02/update-search-center-for-all-sites-in-a-web-application

 

SharePoint 2013 Upgrade Process – Part 2


Continuing on the SharePoint 2013 upgrade process from previous post, we will see some considerations and commands while planning upgrading content databases to SP 2013.

When you have upgraded to SharePoint 2013 from SharePoint 2010 the sites are still in 2010 format. The sites themselves have to be updated as well.

Farm Administrators can run the command “Request-SPUgradeEvaluationSiteCollections”  This creates an evaluation site collections and renders all the content in a different site collection.

The below command shows how many days the evaluation site will be stick around for evaluation.

retention1

We can push the reminder to upgrade the site collection :  $weba.UpgradeReminderDelay = 5

In case if you does not want to upgrade a site collection you can disable the option to upgrade for site collections users from SP management shell.

disableselfserviceupgrade

Lets see some throttle settings at Site Collection level, which shows the ConcurrentUpgradeSessionLimit which on requirement we can either decrease or increase. If we have a small content upgrade it better to spike the limit up otherwise it will not be much help.

concurrentsession

Throttle settings on content database upgrade

concurrentsession-CDB

 

Lets see some more action while we initiate a site collection upgrade from SP management shell.

scupgrade

 

Coming to some options while running either the site collection upgrade or content database upgrade, we have options to “-Throttled” or “-Unthrottled” what unthrottling means it just upgrade everything  immediately as a priority and will not put in throttling queue.

We can get the upgrade session info status by running this command “get-spsiteupgradesessioninfo -contentdatabase wss_content -showinprogress” we have other options like “-showcompleted” and “-showfailed”

we can remove a site from upgrade if its already queued to upgrade with “remove-spsiteupgradesessioninfo -identity http://intranet/sites/it&#8221;

Upgrade-SPContentDatabase WSS_Content -NoB2BSiteUpgrade -UseSnapshot

 This example upgrades the existing WSS_Content content database schema only while using a snapshot of the database to retain read-only access to the content during the upgrade. No build-to-build upgrade actions are performed on any site collections. This operation does not change the CompatibilityLevel for existing site collections in this database.

We have seen some of the PowerShell help necessary for upgrading. But we need to plan and test the whole process from a staging farm before and look at the upgrade performance and plan the schedule. Once again this is purely from and SharePoint Admin perspective, later in another post we will look at other dev aspects which are key for smooth upgrade.

http://technet.microsoft.com/en-us/library/cc262483(v=office.15).aspx                                                  http://technet.microsoft.com/en-us/library/ff607813(v=office.15).aspx

SharePoint 2013 Upgrade Process


[dropcap][/dropcap] [dropcap][/dropcap]How to we get the SharePoint 2010 upgraded to 2013?

We do not have anymore inplace upgrade, so we need to bring the databases over to SharePoint 2013 Farm. So we need to have SharePoint 2013 farm built, services setup and server distribution before the upgrade.

What are the high level upgrade Stages?

upgrade-stages

 

What service applications can be upgraded?

Only a few of the service applications below can be upgraded.

  1. Managed Metadata
  2. Business Data Connectivity
  3. Secure Store
  4. Search Administration
  5. PerformancePoint
  6. User Profile – Profile, social and sync databases

How are the service applications upgraded?

Restore the database from 2010 farm and in required rename it while restoring to any new 2013 service app database naming convention. Then can use this database name while creating new service application either from CA or with

serviceapp

How can we upgrade upgrade Site Collections or Content databases?

This involves three steps: Get the databases restores in SQL server. Mount the content database associated with web application. Upgrade the site collection from the sites banner. Or upgrade the content database and the associated site collections with PowerShell.

While upgrading consider  – how are the cpu, memory and disk IO doing as the process running on the servers. Before we do the production upgrade we need to have an test or stage 2013 farm where we can run and note how long the upgrade can take will it help if we run the upgrade parallel. Upgrade performance is very crucial while planning for production upgrade.

We can upgrade as an administration all the content databases, and as a user they can upgrade their site collections by clicking on the upgrade banner.

sc-upgrade

We will see other detailed admin upgrade commands and considerations in the following post.

Shredded Storage in SharePoint 2013


What Is Shredded Storage:

Shredded Storage is going to help us with BLOBS (Binary Large Objects).

  1. It’s reduces the network IO by shredding the document into smaller pieces and reassembling when someone requests it.
  2. It reduces the amount of data saved in content databases.
  3. It decreases the amount of network traffic between the web servers and the SQL servers.
  4. Allows for faster backup of content databases.

shreddedstorage

 

Other Benefits:

  • A User can open a cached document, and start working with it before it is completely downloaded.
  • Documents are uploaded to the server in the background.

Shredded Storage is on by by default. It can be disabled or enabled per web application. BLOBs are not shredded on an upgrade. Shredded Storage  is independent of RBS.

 

Sharepoint 2013 Service Pack 1 is coming… early next year 2014.


Service Pack 1 is coming…

Bill Baer (@williambaer) is a senior product manager on the SharePoint marketing team.

Today we broadly announced the upcoming availability of Service Pack 1 for Office, Exchange, and SharePoint early next year. 

Service Pack 1 represents a major update to SharePoint, establishing a new baseline for support, and provides customers the latest in improvements to performance, stability, and security.

Update from Microsoft Sharepoint Blog

I want to give you a quick heads up that early next year we’ll release Service Pack 1 (SP1) for the 2013 set of products including Office, SharePoint and Exchange.  SP1 will deliver performance enhancements, feature updates and improve compatibility with Windows 8.1.