lunes, 5 de junio de 2017

Change SharePoint STP lenguage

An easy way to copy a list with content between to sites is to create a list template, upload it in the other site to the list template gallery and create a new list with the uploaded template.

The problem starts when the site templates have different languages. For example you create a list template in a site with english site template and you upload it to a site with a german site template, you'll not see the template in the create page.

Extract the template file

Now we will modify the .stp file. An .stp file is nothing more than a microsoft cabinet file. Therefore rename the file from "mylist.stp" to "mylist.cab". You can now open the file and see all the compressed files inside.

Afterwards open the manifest.xml in the mylists folder and change the language code within the xml to the destination language code. (See Language Codes )

Create a new template

In this step we create the stp again. Unfortunately it is not so easy as it seems to be. First of all we have to create a .ddf file. Create a new file in the mylist folder and rename it to "definition.ddf".

Open the .ddf file and paste the fallowing code inside:

; DIAMOND Directive File (.ddf)
.OPTION EXPLICIT
; Generate errors on variable typos
.Set CabinetNameTemplate=mylist.stp
.Set Cabinet=on
.Set Compress=on

;The files specified below are stored, compressed, in the cabinet file
30000000.000
manifest.xml

In the last section write down all the files which should be within the new .stp file. These should be all except the .ddf file.

Create cabinet

Open the DOS command promp and go to the mylists folder. Type the following command:

makecab /f definition.ddf



The result should end in a mylist.stp file within a subfolder. You can now go and upload the new .stp file to the list gallery of your destination site.

jueves, 1 de septiembre de 2016

Set retention period for Usage definitions


Here's a sample script that will set the retention period to three days:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Set-SPUsageDefinition -Identity "Sandboxed Requests" -DaysRetained 3
Set-SPUsageDefinition -Identity "Content Import Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Workflow" -DaysRetained 3
Set-SPUsageDefinition -Identity "Clickthrough Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Content Export Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 3
Set-SPUsageDefinition -Identity "Feature Use" -DaysRetained 3
Set-SPUsageDefinition -Identity "Search Query Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Site Inventory Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Sandboxed Requests Monitored Data" -DaysRetained 3
Set-SPUsageDefinition -Identity "Timer Jobs" -DaysRetained 3
Set-SPUsageDefinition -Identity "Rating Usage" -DaysRetained 3

When a file can't be check-out / check-in or deleted because is locked from someone

Hello!

This is the time, when you can do magic via PowerShell..!

The PS script to unlock your file is this one:

$web = get-spweb "SITE URL"
$list = $web.Lists["LIST NAME "]
$item = $list.Items.GetItemById(DOCUMENT ID)
$item.File.ReleaseLock($item.File.LockId)
$web.Dispose()

ie:
$web = get-spweb "https://abcde.com/team/IT/SharePoint/"
$list = $web.Lists["Documents"]
$item = $list.Items.GetItemById(225)
$item.File.ReleaseLock($item.File.LockId)
$web.Dispose()

There are different ways to find the DOC ID, however the easy way is adding in your VIEW (list/library) the column named ID.

Cheers!

miércoles, 31 de agosto de 2016

Recreating the User Profile Service application using the old databases

Hello! 

Recently I have been doing some testing about the User Profile service application, and I had some issues with this picky service. I tried to fix it, but the only way to solve this is deleting the current UPA and creating one from scratch.

Guess what!!... Some users have information at MySite.. So I can't delete the content databases..

So based on this, and avoiding bunch of emails from the business asking for their information, let's recreate the UPA using current databases.

  1. Via Central Administration, STOP the User Profile Application service on all servers in the farm.
  2. Delete the User Profile Service Application, but DO NOT CHECK the option "Delete data associated with the Service Application"
  3. Identify the names of the User Profile (Social, Sync, Profile) databases.
  4. Open the SharePoint 2013 Management Shell
  5. Run the New-SPProfileServiceApplication command passing in parameters for: ApplicationPool, Name, MySiteHostLocation, ProfileDBName, ProfileSyncDBName, SocialDBName. This will create a new Profile service app using our restored profile databases. 
  6. Run the New-SPProfileServiceApplicationProxy command passing in parameters for: ServiceApplication, Name and also include the DefaultProxyGroup.
  7. Start the UPA Service on all servers in farm (all servers required)
  8. Run an IISReset on each servers
  9. Start the User Profile Synchronization Service on the application server (server that will host this service) 
  10. Wait... 
  11. Wait...... 
  12. Ensure that it is started before proceeding..!
  13. Ensure that the User Profile Sync timer job is enabled and set properly and then start a full import.. 
 Remember to test this at lower environments BEFORE doing this at PROD

Cheers! 

viernes, 24 de abril de 2015

Ups, I forgot the SharePoint Passphrase! No problem


Getting a high load on your farm and you decide to add a new Web Front End to the mix. Oh no! You forgot that SharePoint Passphrase to allow you to connect to your farm.

Before you start freaking out, check out this powershell command

Get-Help Set-SPPassPhrase -Detailed

To easily reset your SharePoint Passphrase
$passphrase = ConvertTo-SecureString -String "mySharePoint2010password" -asPlainText -Force
Set-SPPassPhrase -PassPhrase $passphrase -Confirm

Cheers! 

miércoles, 18 de febrero de 2015

Webcast: El Fundamento para un Dashboard Ejecutivo de Análisis de Datos en SharePoint




La comunidad de SharePoint Costa Rica junto con Carlos Cerrato les presenta una jugosa charla sobre dashboards con JavaScript para tu SharePoint.

Registrate en el siguiente vinculo:

EventBride