Thursday, 5 March 2015

Diagnose and Clean MissingWebPart and MissingAssembly issues

Hi all,

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


How to:

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

Step 2:
 - Select the WebPart Class GUID

Step 3:
 - Run this command with the related WebPart Class GUID:

Run-SQLQuery -SqlServer "SRV_DATABASE" -SqlDatabase "SharePoint_Content_sharepoint_db_name" -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:

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


 - The URL to use is:                http://shareppoint.contoso.com/Sites/blahblahsite/Sandbox/TestWSServiceLevelDashboard/default.aspx?contents=1

 - 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.


Thanks all folks

User credential issue in SharePoint Site

Hi all,

Today, I'll talk about an strange SharePoint issue, but it's not an issue from SharePoint.

It's a client side issue.


Facts:
 - User is Site Collection Administrator
 - User gets popup to enter his login/password (credentials) when accessing to his SharePoint Site
 - Login & Password are correct
 - Login to his SharePoint site from another computer is working (this is the first test I've asked the user to do and provide me his feedback)


Solution: Check the user credentials on your computer:

 - Click on Start
 - Control Panel
 - User Account
 - Credential Manager
 - Remove from Vault all references to SharePoint sites


Possible reason:
 As company policy, we must change our password several times per year.
 I bet that Windows kept (for this user) his old password in cache, thus replacing automatically his credentials by the one stored in the Credential Manager.



That's all folks

How to : Add new file type in SharePoint 2010

Hi all,

Today’s task is to add a new managed file type.
The file type is .dmmx from Dropmind.

To achieve this request, I’m following the blog page of Romain K.


Step 1 : Assign an icon to the document in SharePoint

  1. Find a png image of the icon of 16 x 16 pixel with transparency : 
  2. Copy this .png file to your Hive14 folder : ..\14\Template\Images\dropmind.png
  3. Register the picture in the ..14\Template\xml\DOCICON.XML file
        In the section <ByExtension>, add:
                <Mapping Key="dmmx" Value="dropmind.png" />

  4. Save the file and test the upload of a .dmmx file:



Step 2 : Declare document mime type as “downloadable” in IIS

  1. Open IIS Console, and browse to your Web Application


  2. Double click on the “Mime Types” menu of the selected Web Application (because I only allow this type of files on a specific Web App)



  3. In the “Action Pane”, top right of the IIS Console, click on the “Add…” button
  4. Declare the custome Mime Type:



  5. Via PowerShell, let’s declare the Mime Type as “Downloadable”:

          $web = Get-SpWebApplication -Identity <WebApplication>
          $web.AllowedInlineDownloadedMimeTypes.Add("application/vnd.dropmind")
          $web.Update()


  6. Now, I’m able to download the file from my SharePoint Site:




Thank's all folks


How to retrieve lost WSP package to prepare the SharePoint migration

Hi All,

In order to prepare the migration of our SharePoint 2010 Farm to SharePoint 2013 Farm, I discover that old wsp packages were still present on the content databases.

Some of them are “relics” from SharePoint 2007 …


Of course, it is not possible to find where those wsp files are stored, and the old SharePoint 2007 servers are removed from the network since several years…


First, I started to enumerate the deployed solutions via PowerShell:

Cmdlet used:
Get-SPSolution | ? { $_.Deployed } | % { $_.DisplayName}

As output, I had this list:

mycompany.customertemplate.wsp
mycompany.mysite.branding.wsp
mycompany.po.projectsitedefinition.v1.2.0.wsp
ev_sharepointwebpartscab.cab
extendeddiagnosticproviders.wsp
sharepointsocialnetworking.wsp


Then, I’ve executed the next code to iterate the solutions collection and to retrieve all missing .wsp, using my previous list:

Add-PSSnapin Microsoft.SharePoint.PowerShell

$farm = Get-SPFarm
$file = $farm.Solutions.Item("<YourSolutionFile>.wsp").SolutionFile
$file.SaveAs("D:\temp\<YourSolutionFile>.wsp")


i.e:
$farm = Get-SPFarm
$file = $farm.Solutions.Item("mycompany.customertemplate.wsp").SolutionFile
$file.SaveAs("D:\temp\mycompany.customertemplate.wsp")


Now, I can yuse those .wsp, in my SharePoint 2010 test-farm.
I'll then prepare the databases by cleaning them from the old useless solutions.




That’s all Folks,



Marc



***** Disclaimer *****
http://www.belgacom.be/maildisclaimer

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 !!!