Posts

Showing posts from April, 2015

Copy SharePoint views to other libraries with PowerShell

[CmdletBinding()] Param (   [Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$WebURL,   [Parameter(Mandatory=$true)][string]$SourceList,   [Parameter(Mandatory=$true)][string]$SourceView,   [Parameter(Mandatory=$false)][string]$NewViewName,   [Parameter(Mandatory=$false)][string]$TargetURL,   [Parameter(Mandatory=$false)][string]$IgnoreLibs,   [Parameter(Mandatory=$false)][string]$AsDefault,   [Parameter(Mandatory=$false)][string]$OutputPath,   [Parameter(Mandatory=$false)][string]$SmtpServer,   [Parameter(Mandatory=$false)][string]$EmailFrom,   [Parameter(Mandatory=$false)][string]$EmailTo ) Function Copy-SPView {   Write-Host "Loading Sytem Modules "   Get-Module -listAvailable | import-module   if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )   {     Write-Host "Loading Sharepoint Module "  ...

Sharepoint 2013 – "Sorry we could’t follow the document or site"

Image
Problem Now what this is really about and the reason why you stopped at this post. SharePoint 2013 gives an error when you hit the ‘ Follow ‘ button with the next message: Something went wrong. In this example I tried to follow a document in a library. Cause This pop-up doesn’t provide a lot of information. except that it’s not working. The next step is to check the good old SharePoint logs at the ‘ 15 Hive ‘ location: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS Analyzing the log file shows that there is a problem opening the content database hosting the users My Sites. Hmmm Now is starts to get interesting. reading further down the logs shows the name of the user account that has failed to login. ( search the term ‘for Cannot open database’ ) The cause of this problem is that the Application Pool Account has no access to the database. This is most probably caused by the service accounts that are used for the SharePoint default we...

No image for PowerPivot Gallery in all Site Content SharePoint

Image
While working on a migration project of a SharePoint 2010 to SharePoint 2013 site collection using BI, I found quite a few bugs. One of them is that, when you go in “All Site Content”, the PowerPivot Gallery doesn’t show the image, or better said, cannot show the image. It’s not the biggest SharePoint bug, however it can be annoying especially for end users. I opened up Chrome Dev tools, and I found out the source of the bug… the developers did a spelling mistake in the image reference. Instead of PowerPivot… meet the new LowerPivot .  It’s pretty hard to change the code that brings this bug and given the importance of it, it won’t probably be fixed by Microsoft soon, so here is how you can easily fix it in your farm. Navigate to “ C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\IMAGES\PowerPivot ” and no, 14, is not a spelling mistake! Even if we are in SharePoint 2013, the picture still resides in the 14 hive. Copy the “power...

PowerPivot Resource File not found when creating new PowerPivot Gallery Document

Image
While working on SharePoint 2010 to SharePoint 2013 migration, a site collection with Business Intelligence on it had quite a lot of bugs after being upgraded to 2013.. One of the bugs I found is that in a PowerPivot Gallery, whenever you want to create a new PowerPivot Gallery Document, you get this instead: $Resources:PowerPivotFeatures,ReportGalleryDocumentDisplayName; $Resources:PowerPivotFeatures,ReportGalleryDocumentDescription; After investigating, I found out that you get the same message when you look at the PowerPivot Gallery Document content type. With the info we got in those screenshots it’s pretty clear that the problem is a resource file, but why? The problem is that Microsoft, decided to rename the resource file names between SharePoint 2010 and SharePoint 2013. If you go on SharePoint 2010 in “ C:\Program Files\Common Files\Microsoft shared\Web Server Extensions\14\Resources ” You will see that all the PowerPivot resource files are named “ PowerP...

SharePoint SSRS Add in fails – rsCustomAction.exe failed to configure, Error code is: 1

Image
While configuring SharePoint Server Reporting Services (SSRS) at my client, I had a really strange problem on one of the farms… I couldn’t get the SSRS Addin to install. I tried rebooting, repairing but nothing. After digging out in the logs, I found this funny error message: CA MSG : rsCustomAction.exe failed to configure, Error code is: 1 CustomAction RSSP_CAInstall_64 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) Also, for the information I was running SQL 2012 SP1 + Windows Server 2012 R2. You might also see something like this in the logs: Long Story Short, after a lot of googling and asking for help from SQL & SharePoint masters, I found out that the bug is because I had a line commented in the web.config file of a web application. As strange as this may sound, after deleting the commented line, the install went through perfectly. I couldn’t find any official documentation on this, so if this...

SharePoint 2013 SSRS – The remote server returned an error: (500) Internal Server Error

Image
While (trying) to install SharePoint Server Reporting Services at one of my clients, I got into some pretty nice errors (SSRS Errors, Gotta catch ‘em all!). This one was the one that made me crazy for a few weeks because I never found out why I was having it, however I found out a way to fix it that worked, so I will share it with you in order to not lose hair over it like me. The error is basically getting a The remote server returned an error: (500) Internal Server Error whenever you click on either “System Settings” or “Manage Jobs” The error: This doesn’t tell us much, however when we go into Event Viewer we find two event IDs that are related to this and they both have similar messages. Event ID 6398 The thing we find in common in both those errors is “Could not find permission set named ‘ASP.Net'”. After countless hours spent on google, bing and even yahoo and after even some of the best SharePoint people I know couldn’t find the issue, I ...

PowerShell Script to get all the Active Directory groups in your SharePoint Farm

Image
At a client recently, I was tasked to create an inventory of all the Active Directory Groups that give access to a SharePoint site! I built it mostly from scratch, so here it is as well as some explanations to help you use it: function WriteLogs ($message) {     $message | Out-File $logfile -append } $logfile = "C:\ADGroupInventory\grouplist.txt" Write-Host "Starting Group Script inventory" $was = Get-SPWebApplication foreach ($wa in $was)  {          $webappUrl = $wa.url   Write-Host "Starting to look in $webappUrl"   $spWebApp = Get-SPWebApplication $wa.url          foreach($site in $spWebApp.Sites)   {     $siteurl = $site.url     Write-Host "Going into SiteCollection $siteurl"     $group = $site.RootWeb.SiteUsers     foreach ($grp in $group)     {      #...

SharePoint 2013 Site Template ID List for PowerShell

Template ID Title GLOBAL#0 Global template STS#0 Team Site STS#1 Blank Site STS#2 Document Workspace MPS#0 Basic Meeting Workspace MPS#1 Blank Meeting Workspace MPS#2 Decision Meeting Workspace MPS#3 Social Meeting Workspace MPS#4 Multipage Meeting Workspace CENTRALADMIN#0 Central Admin Site WIKI#0 Wiki Site BLOG#0 Blog SGS#0 Group Work Site TENANTADMIN#0 Tenant Admin Site APP#0 App Template APPCATALOG#0 App Catalog Site ACCSRV#0 Access Services Site ACCSRV#1 Assets Web Database ACCSRV#3 Charitable Contributions Web Database ACCSRV#4 Contacts Web Database ACCSRV#5 Projects Web Database ACCSRV#6 Issues Web Database ACCSVC#0 Access Services Site Internal ACCSVC#1 Access Services Site BDR#0 Document Center DEV#0 Developer Site DOCMARKETPLACESITE#0 Academic Library EDISC#0 eDiscovery Center EDISC#1 eDiscovery Case OFFILE#0 (obsolete) Records Center OFFILE#1 Rec...

Move SharePoint 2013 Search Index Location

#----------------------------------------------------------------------------- # Name:               Move-SPEnterpriseSearchIndex.ps1  # Description:      This script will move the SharePoint 2013 Search Index         # Usage:               Run the function with the 3 required Parameters  #----------------------------------------------------------------------------- function Move-SPEnterpriseSearchIndex($SearchServiceName,$Server,$IndexLocation){     Add-PSSnapin Microsoft.SharePoint.PowerShell -ea 0;     #Gets the Search Service Application     $SSA = Get-SPServiceApplication -Name $SearchServiceName;     if (!$?){throw "Cant find a Search Service Application: `"$SearchServiceName`"";}     #Gets the Searc...

How to: Perform a SharePoint 2013 site collection visual upgrade with PowerShell

Image
To begin the process, I have restored a copy of my content database from my SharePoint 2010 environment on the SQL Server for my SharePoint 2013 environment.  The first thing we need to do is mount the content database with Mount-SPContentDatabase . In SharePoint 2010, this process would actually update the database and perform the upgrade.  Now, it actually just attaches the database but leaves the site running in SharePoint 2010 mode.  Effectively you are running a full copy of SharePoint 2010 inside SharePoint 2013.  You can do this and upgrade each site collection one at a time to make the transition process a bit easier. Typically, when you are doing this, you’ll execute Test-SPContentDatabase first and resolve any reported issues.  Just like in SharePoint 2010, you need to install all of your customizations via solution package prior to mounting.  Test-SPContentDatabase can help you find some of these customizations if they are missi...

SharePoint 2013 page loads takes a very long time

Image
I was about to give up on one of my labb SharePoint 2013 Environments because it was so extremely slow all the time. Warmup scripts, reloads, more memory, more CPU, stopping services, stopping search …nothing helped. I had a constant loadtime of all aspx pages of 6+ seconds, 6.10-6.20 something. Even when the page was just loaded and I pressed F5 to reload, it still took 6.10 seconds. This was an environment that gave you sensitive nerves… So, after looking for any solution or more like looking for the little issue that caused this all day, I gave up more or less. – CPU was at a maximum 40% on SQL, SharePoint cranked it up to 18%… – Memory consumtion was at 25% of the 12GB SharePoint had… – SQL was Lightning fast to all other SharePoint farms… – Network utilization showed about 100Kbps at the most… I scavenged the internet as usual and found nothing but the standard: add more memeory, add more CPU, stop services, stop search… None of that helped and I had tr...

Empty pages when new site collection is created SharePoint

Image
Introduction In this post we will see how to fix the blank page error when new web application or site collection is created. It is also observed that when we browse central admin it shows blank page where as all the settings are fine. What ever might be the case, you can fix this problem New Site Collection In my case I am getting blank page when navigated to the new site collection which I have created. Fixing the problem Go to the IIS and select the respective web application. Here, I have selected the web application to which the site collection belongs to. Double click the Authentication icon as in the following diagram Set the status of ‘Basic Authentication’ from ‘Disabled’ to ‘Enabled’. Now the site opens normally Conclusion The problem is annoying until we fix it with a simple solution. This problem is faced on the SharePoint 2010 dev environment installed with Windows 7 Home Premium. Sometimes we face the same issue with central admin after i...

You receive a blank page when you visit a SharePoint Server 2010 Web site from the server that is hosting the Web site

When you use a fully qualified domain name (FQDN) or a custom host header to visit a Microsoft SharePoint Server 2010 Web site or a Microsoft SharePoint Foundation 2010 Web site from the server that is hosting the Web site, you receive a blank page. Note You only receive a blank page if you try to visit the Web site directly from the server. If you visit the Web site from a client computer, you can view the Web site. Cause : This problem occurs when the Web site uses Windows Integrated Authentication and the Web site has a name that is mapped to the local loop back address. Solution : To work around this problem, disable the loop back check or specify host names.

External access gives a blank home page SharePoint 2013

Image
I've created a site that serves as a service portal. It requires a customer to login, so when accessing the home page, when not authenticated, you'll get redirected to the login page. On the site anonymous access is enabled as the customers don't need to login to SharePoint itself. When I access the home page from the localhost or any other machine in the intranet everything works fine. (Going to http://sharepoint/ and this will automatically redirect to http://sharepoint/SitePages/Home.aspx ) When trying to access the SharePoint from the outside e.g. http://helpdesk.company.com . I get the following page: http://helpdesk.company.com/_layouts/15/start.aspx#/SitePages/Home.aspx This page appears to be empty and when clicking the Home link, I remain on this page. When I remove /_layouts/15/start.aspx# from the URL it navigates to the correct page where I putted my web parts. Does anyone know why its behaving like this?     Solution :   i think what it i...

Repair corrupted SharePoint 2013 Distributed Cache cluster

Before you begin, please check if your SharePoint farm SQL servers are using Dynamic memory on ESX or Hyper-V. If yes - Turn it OFF! And check if it helped. Launch AppFabric PowerShell console and execute: Use-CacheCluster Get-CacheHost Check if Cluster is 'UP' If not then: Start-CacheHost –ComputerName [yourServerName] –CachePort 22233 then get your SharePoint farm GUID $spFarm=[Microsoft.SharePoint.Administration.SPfarm]::Local $spFarm.Id Export your current cluster configuration as backup. For reference and just in case.. Export-CacheClusterConfig c:\Backup.xml Replace text in XML bellow: YOUR-FARM-ID to your farm GUID, CONTOSO\ClusterServiceAccount to your cluster service account, SERVER1.COM to your cluster host. Copy host section if you have multiple cluster hosts and change server name. Change hostid like in Backup.xml and refer to other configuration details in this file. <?xml version="1.0...