Thursday 11 December 2014

SharePoint 2013 Upgrade Check List

Hi all,

Today, I’ve put all together my SharePoint 2013 upgrade experience.

As I have lot of Farms to admin, in different environments (Prod, pre-Prod, Test), I was faced to several issues.
So, in the ease for everyone, I’ve tried to figure out all the issues I had to solve.

This post is divided in 2 Sections:
1.       Pre-Upgrade CheckList: this is mandatory prior every upgrade
2.       Installation Process: binaries, and how I proceed the upgrade
3.       Trouble shooting: if something is wrong, the solution should/must be in this section


1.       SharePoint 2013 pre-Upgrade CheckList:
- Farm & Install accounts must be DB Owner on all system & content DBs
- Farm & Install accounts must have Security Admin  on all system & content DBs
- If there is mirroring, it must be stopped
- If there is Availability Groups, all DBs must be removed from the A.G
     *Update1: the USAGE database must not be part of an A.G nor mirroring
        This DB name is found in the "Manage servers in this farm" section in Central Admin
        The usage database name is like: <db_name>-USAGE
     *Update2: the "SPPLA-AppManagement" DB must also be removed from the A.G or mirroring
     
- Copy all needed binaries that must be applied (CU, PU, SP)


2.       Installation Process:
- Logon each server with your Install account
- Launch the binaries installation (exe file). This step can take up to 2,5 hours.
- Reboot all servers
- Check in Central Administration GUI that all servers status are: Upgrade required
- Launch, on each servers the Configuration Wizard, but one step at a time.
   --> launch Configuration Wizard, click "yes"
   --> do the same for each servers of the Farm
- Click "Next" on your Central Admin Server (always start by the Central Admin server).
- When upgrade is finish, DO NOT click to exit.
  Select the next server, and click "Next" in the Configuration Wizard.
  Do the same process to all your server until the last one.
- When all servers are upgraded, close the Configuration Wizard (Next or Finish) and check the server status in the Central Administration GUI:
  "No Action Required"


3.       Trouble Shooting:

What to do if the upgrade fails?
1- Check event viewer for any Farm or Install account access denied in SQL
2- Check ULS
3- Execute the installation via the PSCONFIG cmdlet.

/!\ ..... UPDATE .....  /!\

               PSConfig.exe -cmd upgrade -inplace b2b -wait -force

According to Stefan Goßner, in SharePoint 2013, it is the best paractice to use the PSCONFIGUI.exe instead of PSCONFIG.exe
The reason is because the GUI version is doing more complete upgrade.

For any reason, if you need to use the PSCONFIG.exe, then use this cmdlet:
PSConfig.exe -cmd upgrade -inplace b2b -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources

/!\ ..... UPDATE .....  /!\


What to do if the Configuration Wizard is showing "Missing on <servername>"?
In the configuration Wizard, if there is some installed patches shown as "Missing on <servername>" (and they are already installed), you can use this PowerShell command :
Get-SPProduct -local
Then, press "Refresh" in the Configuration Wizard".
When the servers are no more in the list, you continue the patching process.

What to do if in the error logs (i.e : Upgrade-20141027-143441-40-error) you have this type of message?
Upgrade SPUpgradeSiteSession           ajxnj        ERROR
                at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
                at System.Net.HttpWebRequest.GetRequestStream()
                at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()

                ==> check that all Application Pools are up and running in IIS on all servers

What to do if you have Site Collection upgrade issue?
If you have this type of line in the error log:
ERROR   Pre-Upgrade [SPSite Url=<Your Site Collection URL/...] failed. Microsoft.SharePoint.Upgrade.SPSiteWssSequence has the ContinueOnFailiure bit set.
                ==> upgrade manually yours sites:
                Get-SPSite -Limit all | Where-Object {$_.NeedsUpgrade} | Upgrade-SPSite -VersionUpgrade -Unthrottled


*Update:
If you have this error with the previous cmdlet:

PS C:\Windows\system32> Get-SPSite -Limit all | Where-Object {$_.NeedsUpgrade} | Upgrade-SPSite -VersionUpgrade -Unthrottled
Get-SPSite : There was no endpoint listening at http://localhost:32843/SecurityTokenServiceApplication/securitytoken.s
vc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if 
present, for more details.
At line:1 char:1
+ Get-SPSite -Limit all | Where-Object {$_.NeedsUpgrade} | Upgrade-SPSite -Version ...
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...SPCmdletGetSite:SPCmdletGetSite) [Get-SPSite], Endpoint 
   NotFoundException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSite

Check that those Services are running:
  - SPAdminV4
  - SPTimerV4
  - W3SVC

Reason:
 This is due to a faulty PSCONFIG.exe cmdlet.
 If the upgrade is not successfull, then the services are not started back.



That’s all folks




Sunday 22 June 2014

Issue with SharePoint 2013 Farm Update

Hi all,

Last week, I was facing lot of issue applying the SharePoint 2013 SP1 upgrade.

First, was installing the binaries on each SharePoint 2013 server.
It took me an average on 2:30 hours per server.
The only advantage is that the binaries can be installed on each Farm server at the same time.

Then, I've prepared all my SharePoint Servers (15 servers ....) with the SharePoint Configuration Wizard.

At that moment, I was facing an extreme long long long configuration time for the Wizard.

Checking the sharepoint logs, I had only lines about PowerShell doing something... time to time.


After restarting the Wizard several times, and letting the Wizard working at his own way, I discovered that using the Configuration Wizard was not the solution.
Thus, I've decided to do the configuration via the psconfig.exe.
When there is an error, it shows clearly the issue.

Thus, I've discovered that executing the configuration wizard with the Install account gave issue in the database access.
When executing the configuration wizard with the Farm account, it gave insufficent access rights to some DB.

At that point, I've asked to our SQL Team to set the Farm and the Install account as dbo (db owner) to all DB's of the Farm.

Thus, executing the configuration wizard went without any issue, and each server was configured, one by one in less than 30 minutes each.


I've asked our Microsoft consultant about this issue, and he was not aware of the problem.
I've showed him my server, and he told me (before I discover the problem) that powershell was still working, and I have to wait....


So, before installing SP1 (or CU, or PU), do not forget to double check the access rights of your farm and install account.
Doing this will save you lot of time when installing SP, CU or PU in SharePoint 2013 (and in extension for SharePoint 2010)


Voilà, I hope it'll help you saving lot of time.


Job's done.

Tuesday 25 February 2014

How to sign in as a different user in SharePoint 2013

Hi all,

Today I had to login to a SharePoint 2013 site with the farm account, from my desktop.

I simply add “/_layouts/closeConnection.aspx?loginasanotheruser=true” after the site URL :

http://MyProjectSite.contoso.com/Sites/Shp4DummiesProjects/_layouts/closeConnection.aspx?loginasanotheruser=true



Voilà,

That’s all Folks !!!

Tuesday 28 January 2014

SharePoint 2010 : The search function does not seem to work in some cases.

Hi all,

Today, I decided to figure out with a recurrent problem with the Search engine.
Search engine, is the standard version of SharePoint 2010 (not the enterprise version).

And, customers are always complaining about it, saying that it’s not always working.
After checking, testing and log-reading, the only visible thing is : search is working O_°

So, today, I made long tests and reproduce the problem, and give a credible explanation to my customer.

The problem is that the customer is trying to search as in Google, with part of the name.
What is wrong?
It should give back some results, but there is only the “no results found” page sent back to him.


So, I discover that the search engine will only search for the exact word in the path of the file, but it’ll give a result only if the keyword is not part of a word in the file name.

In my example, the customer is trying to have results for “VE11”.
There is no word “VE11” in the library.
But there is “VE 11” in the library, and the search is using them as 2 keywords: “VE” & “11”, and search for each of them.



Input from my customer:
Keyword(s) : SharePoint 2010 : Contoso Internal
Make your selection : Probleem
Describe : The search function does not seem to work in some cases.
Een voorbeeld uit de library “CCJ requests invoiced” op batch datum 11/12/2013:
Example: If we search on “VE 11” as part of a file name from the "CCJ requests invoiced" library, we get no result. If we search on another part of that same file name e.g. “345340” we do find a result. Idem for a search on “TU60” without result, whereas “345225” from the same name, does give a result.
Attachment : Ja

My research and conclusion:
Checked search.
Result found with all given examples.
Test with: "VE 11" and "345340"
VE 11 => several results
               

345340 => 1 result
               

VE11 => no results

VE11L3005493 => 1 result : VE11L3005493 13 ccj 345340.msg

Try to search with this word “ve11l3005493”, starting with first letter, then adding eachletter one by one.
You’ll find out how the search engine of SharePoint 2010 is working.
The search is indexing complete part of the names of the file name, not part of the different names making the filemane.
The matching result is always written in bold.
This is the reason why there is no result for "VE11", but you gor result for "345340", and also results for "VE 11" (as "VE" and "11" are indexed by the SharePoint search engine.



Then, I decided to make a last test : writing the keyword between asterisk  è *VE11*
Et voilà.







That’s all Folks


Monday 27 January 2014

How to Limit the Self-Service Site Creation in SharePoint 2013 to only users added into a specific AD Group

Hi all,

Today, I was asked to allow the self-service site creation for the mySite in my SharePoint 2013 Farm.
As the audience will be only for the test users, I've decided to do in the same way as I've done for my SharePoint 2010 Farm.

1-      Creation of a new AD Group.
          


2-      Set the Self-Service Site Creation to "ON":
          In Central Administration, highlight the mySite Web App
          


          Select the MYSITE Web App, then review all 5 sections:
-          Self-Service Site Creation
-          User Permissions
-          User Policy
-          Anonymous Policy
-          Permission Policy


               

o   Self-Service Site Creation:
              

o   User Permissions: check this in the "Site Permissions" section
         

o   User Policy: use the default values

o   Anonymous Policy: use the default values

o   Permission Policy: use the default values




3-      Configuration of the User Profile Service Application:

In Central Administration, select the "Manage Service Applications" link:

In the "Service Applications" page, select the "User Profile Service Application":



            Now, select "Manage User Permissions" from the "People" section:
              
           From this Window, I've added my AD Group (in blue):

                


The settings for my AD Group is : thus, only users present in this AD Group will be able to create on demand their mySite when entering their mySite URL : http://mySite-uat.xxx.net
               

Do not forget to uncheck the "Create Personal Site" entry to all other groups, otherwise everybody from the organisation will be able to create his mySite.
               





That's all folks



MissingWebPart Error in SharePoint 2010

Hi all,

Today I found useful cmdlets to diagnose and clear those errors in the Content DB of my SharePoint 2010 Farm.

How to proceed:

Step 1: Inspect the DB
-          Test-SPContentDatabase -name <ContentDB_Name> -webapplication <Web App URL>

Step 2:
-          Select the WebPart Class GUID

Step 3:
           -     Create the SQL Function and execute it into PowerShell:

function Run-SQLQuery ($SqlServer, $SqlDatabase, $SqlQuery)
{
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server =" + $SqlServer + "; Database =" + $SqlDatabase + "; Integrated Security = True"
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $SqlQuery
    $SqlCmd.Connection = $SqlConnection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $SqlConnection.Close()
    $DataSet.Tables[0]
}

-          Run this command with the related WebPart Class GUID:

Run-SQLQuery -SqlServer "SRV_DATABASE" -SqlDatabase "SharePoint_Content_sharepointWorkgroup17" -SqlQuery "SELECT * from AllDocs inner join AllWebParts on AllDocs.Id = AllWebParts.tp_PageUrlID where AllWebParts.tp_WebPartTypeID = '9812863c-ee62-dab6-57f5-79e9d4d36022'" | select Id, SiteId, DirName, LeafName, WebId, ListId, tp_ZoneID, tp_DisplayName | Format-List


Step 4:
-          The result will give the below info, with the URL where the Missing Web Part is located:

Id                         : a5da7b36-083f-4d07-b50b-8f1fc8d7bbe9
SiteId                   : 53061278-8b1d-4d6d-9dce-8568f90c5574
DirName              : Sites/WW12000012/Sandbox/TestWSServiceLevelDashboard
LeafName            : default.aspx
WebId                 : 2ab691b1-0d74-4bf2-9524-c6b1d969cfac
ListId                   :
tp_ZoneID           : Left
tp_DisplayName  :



                  Adding at the end of the URL "?contents=1" will let SharePoint to show the "Web Part Page"


-          So, here are the steps that I follow to remove the “ErrorWebPart”:

1- select the Error rows
2- click on “Close” to set them as “No” for the “Open on Page?” column
3- select the same Error rows then Delete them



Step 5:
-          Execute again the “Test-SPContentDatabase” to check that all entries for the MissingWebPart are gone.




That's all folks




How to replace an existing URL located in the Top Navigation Bar

Hi All,

Today's request is to replace the Hyperlink in the navigator bar, as the referenced site URL has changed.




And last but not least, the request is to change this hyperlink to all sites inside the Web App: more than 1800 Site Collection.


This is the used Code:

#----------------------------------------------------------------------
#Below the code to update the topnavigationbar
#  for all Site Collection of the mentioned Web Application .
# Author : Marc Mathot
# Date: November 2013
#----------------------------------------------------------------------
$Webs = Get-SPSite -WebApplication "http://SharePoint.Contoso.com"  -limit ALL | Get-SPWeb -limit all

Foreach($Web in $Webs)
{
$TN = $Web.Navigation.TopNavigationBar | Where-Object {$_.Title -eq "Landing Page & Wiki"}
if ($TN.url -like "http://SharePoint.Contoso.com*")
{
   write-host "Updating $($Web.url)"
  “Updating $($Web.url), $($TN.Url)” | out-file D:\temp\LandingPageUpdate.csv   -append
    $TN.Url = "http://NewSharePoint.Contoso.com/Pages/LandingPageWikiDefault.aspx"
    $TN.update()
}
}
#----------------------------------------------------------------------

Also, in parallel, I had to modify the template used to create the new sites into this Web App.
Doing this will avoid having to run this script periodically to correct the changes.




That's all folks