El TecnoBaúl de Kiquenet

Kiquenet boring stories

Archive for the ‘Sharepoint’ Category

Troubleshooting: Sharepoint Deployments and Powershell

Posted by kiquenet en 13 agosto 2014


Account for Installations




Error This operation uses the SharePoint Administration service (spadminV4), which could not be contacted.  If the service is stopped or disabled, start it and try the operation again.




Term Store in sharepoint 2013 using powershell

Error Current user has insufficient permissions to perform this operation

To resolve the issue:

•Go the Central Administration

•Go to : “Manage service applications” ( _admin/serviceapplications.aspx).

•Select “Managed Metadata Service” to get the Terms Store admin interface.

•In the section : “Term Store Administrators”. Add the user that you use to run sharepoint management shell

•Save the changes.

In SharePoint 2013 Enterprise, I followed the steps above, but it still didn’t work.

Following on from there, I went to the ‘Term Store Management Tool’ in Central Admin (/_layouts/15/termstoremanager.aspx) and added the user there too. This resolved the permissions issue for me.

Cmdlets Sharepoint and Powershell


Read Logging Files Sharepoint

Reading the log file.

The simplest way is opening the log files from the 14$\logs in Notepad. This might be quickest way but not the most efficient in a live multiuser environment. I usually use this in a development environment in combination with a text editor that automatically reloads the file when it’s updated (Notepad++).

Using powershell with a correlation id

You can use powershell to quickly track down a correlation ID and dump the related log files into a file


get-splogevent -starttime (get-date).addminutes(-20) | where-object { $_.correlation -eq “b66db71a-3257-4470-adf9-5c01dc59ecb3″ } | fl message > c:\errors.txt

More info can be found here :

Uls viewer

A Windows application for viewing the ULS logs more easily. Very handy when you are (trying to) reproduce a specific error and during debugging
I use it when I’m trying to track down a specific error and during debugging.



Farm solution

Codeplex also has a nice solution which you can query the SharePoint logs with from within Central Administration.
The solution installs in your Central Administration. Very handy if you want a quick look in your logs files without having to connect over remote desktop to the actual server.
For detailed log digging this tool might not be sufficient.


Visual Studio Integrated ULS Viewer







Posted in .NET, PowerShell, Scripts, Sharepoint | Etiquetado: , , , , | Leave a Comment »

Sharepoint, Powershell, BDC Model

Posted by kiquenet en 28 julio 2014


SharePoint: Removing a BDC model via PowerShell

   In one of the previous posts I showed how to import a BDC model; the current one is about removing. The following script allows to remove a bdc model by its name:

$model = Get-SPBusinessDataCatalogMetadataObject

-Name "yourModelName" -BDCObjectType Model -ServiceContext "http://yourWebAppUrl"

Remove-SPBusinessDataCatalogModel -identity $model -Confirm:$false

Note: here command line parameters are wrapped to the next lines for readability only. In SharePoint 2010 Management Shell, each command and its parameters should be in the same line.

The Get-SPBusinessDataCatalogMetadataObject command gets a Model object by its name and saves reference to it in the $model variable. The Model object is relevant to your web application accessible through the url http://yourWebAppUrl. As its name implies, the Remove-SPBusinessDataCatalogModelmethod removes the received model using the $model variable. -Confirm:$false allows to skip an YES/NO confirmation arising right before a model is deleted indeed. Remember that the operation isn’t reversible, use the -Confirm:$false with precaution.

If you need to remove all bdc models, you can use the script as follows:

$metaStore = Get-SPBusinessDataCatalogMetadataObject

-BdcObjectType Catalog -ServiceContext "http://yourWebAppUrl"

foreach ($model in $metaStore.GetModels("*")) {

Remove-SPBusinessDataCatalogModel –Identity $model -Confirm:$false


Note: here command line parameters are wrapped to the next lines for readability only. In SharePoint 2010 Management Shell, each command and its parameters should be in the same line.


SharePoint: Deploying a BDC model via PowerShell

    In SharePoint 2010 a BDC model can be easily deployed using PowerShell. Launch SharePoint 2010 Management Shell (click on Start, then All Programs -> Microsoft SharePoint 2010 Products ->SharePoint 2010 Management Shell) and execute the following script:


$metaStore = Get-SPBusinessDataCatalogMetadataObject

-BdcObjectType "Catalog" -ServiceContext "http://yourWebAppUrl"


-Path "c:\folder\subfolder\yourfile.bdcm" -Identity $metaStore -Force

Note: here command line parameters are wrapped to the next lines for readability only. In SharePoint 2010 Management Shell, each command and its parameters should be in the same line.

The first command, Get-SPBusinessDataCatalogMetadataObject, returns and saves in the $metaStorevariable a Catalog metadata object relevant to your web application accessible through the url http://yourWebAppUrl. The second command, Import-SPBusinessDataCatalogModel, imports a Business Data Connectivity Model defined in a file, path of which is indicated by the -Path key. The model is to be added to the Catalog referenced by the $metaStore and overwrites the existent version (if any) due to the -Force key.

Despite the -Force key you can get the following error:

Error: Cannot merge contents of LobSystem (External System) with Name 'Products'
as it appears to be different from a preexisting LobSystem in the current load context.

What you need to do in this case is remove the previous version of the model.





Posted in PowerShell, Scripts, Sharepoint | Etiquetado: , , , | Leave a Comment »

Sharepoint Projects and Crash VS 2012

Posted by kiquenet en 22 julio 2014

I get this error in my Sharepoint 2013 Project when I try Publish it (for generate WSP file)

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: devenv.exe
  Problem Signature 02: 11.0.50727.1
  Problem Signature 03: 5011ecaa
  Problem Signature 04: Microsoft.VisualStudio.SharePoint.Project
  Problem Signature 05: 11.0.60226.0
  Problem Signature 06: 512c2dba
  Problem Signature 07: 18a8
  Problem Signature 08: 1d
  Problem Signature 09: System.NullReferenceException
  OS Version:   6.1.7601.
  Locale ID:    2057
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
  1. Exe File Name
  2. Exe File assembly version number
  3. Exe File Stamp
  4. Exe file full assembly name
  5. Faulting assembly version
  6. Faulting assembly timestamp
  7. Faulting assembly method def
  8. Faulting method IL Offset within the faulting method
  9. Exception type

And also here is a MSDN article on the same.

Finally, I get a solution. In my csproj file, it was dissapeared Package Folder.

Only I do this steps:

  • Edit csproj file
  • Add this nodes (for include Package folder and files)
  • Reload csproj Project
  • Publish again
<None Include="Package\Package.package">
<None Include="Package\Package.Template.xml">


Basically you need to make sure that the "site url" is not blank.


Posted in .NET, Sharepoint, Soporte | Etiquetado: , , , , , | Leave a Comment »

Add Farm Administrator by using STSADM

Posted by kiquenet en 28 agosto 2012


one day we lost access to ourSharePoint Central Administration. The reason of this was that someone deleted the BUILTIN\Administrators from the Farm Administrators group.

No problem, just add the BUILTIN\Administrators back to the Farm Administrators Group.

But how do you do this without access to the Central Administration?

Well, after some searching and googling I found a solution. You can use STSADM to add people to groups in a Site Collection and the Central Administration is just another Site Collection.

I know the suspense is killing you so here ‘s the STSADM command:

stsadm -o adduser -url http://server:12345 -userlogin BUILTIN\Administrators -useremail admin@company.com -group “Farm Administrators” -username “Administrators”

Referencias: http://www.sharepointology.com/setup/add-farm-administrator-by-using-stsadm/


Lo mejor es tirar de TechNet, es lo más completo http://technet.microsoft.com/es-es/library/cc303422

Desde la Administración Central de SharePoint >  Security> Manage the farm administrators group

New > Add Users

Posted in Scripts, Sharepoint | Leave a Comment »