Dec 11, 2014

SharePoint Foundation 2013: Missing search box? Unable to create webpart page?

If you've recently installed SharePoint Foundation 2013 SP1, you may have the following errors:
  • Missing search box
  • Error creating a web part page from IE11: Microsoft.SharePoint.SPException: Unable to create a web part page with the current browser. Browsers that allow web part page creation are Microsoft Internet Explorer versión 7.0 or later, Mozilla Firefox 3.0 or later and Apple Safari 3.0 or later. (translated from Spanish: Microsoft.SharePoint.SPException: No se puede crear una página de elementos web con el explorador actual. Entre los exploradores que admiten la creación de páginas de elementos web se encuentran Microsoft Internet Explorer versión 7.0 o posterior, Mozilla Firefox 3.0 o posterior, y Apple Safari 3.0 o posterior. )

The answer:  install the latest cumulative update package for SharePoint Foundation 2013http://technet.microsoft.com/en-us/library/dn789211%28v=office.14%29.aspx

Dec 8, 2014

Create a Managed Copy from PowerShell

If you've ever tried to create a managed copy from PowerShell, you might have had some trouble updating the source CopyDestinations collection.  I certainly did until I learned I had to use an Assignment collection when opening the source SPWeb object.  Go figure. 

Credit goes to Ryan Spletzer: http://sharepoint.stackexchange.com/questions/79294/spcopydestinationcollection-add-method-does-not-persist-to-the-database

Anyways, here's the code:
function CreateManagedCopy($sourceWebUrl,$sourceRelativeFileUrl,$destinationUrl) {
 Start-SPAssignment -AssignmentCollection $current
 $web = get-spweb $sourceWebUrl -AssignmentCollection $current
 $updatetype = [Microsoft.SharePoint.SPCopyDestinationType]::Update  
 $sourcefile = $web.GetListItem($sourceRelativeFileUrl);
 $sourcefile.CopyTo($destinationUrl)
 $sourcefile.CopyDestinations.Add($destinationUrl, $updatetype, "Copied from PowerShell")
 $sourcefile.UpdateOverwriteVersion() 


}

# To call the function: 
# CreateManagedCopy "https://intranet/sites/test" "/sites/test/libA/test.docx" "https://intranet/sites/test/moveTo/test10.docx"

Oct 16, 2014

Self-signed wildcard certificates for SharePoint 2013

In a post-Snowden era, everyone is encrypting their network traffic with SSL and SharePoint portals are no different.

Wildcard certificates are a good deal if you need several SSL certificates (intranet,extranet, mysites, mail, etc.) and here's how to create your own self-signed wildcard certificate and root authority for development servers.

All the credit goes to Mike O'Brien in this post: http://www.mikeobrien.net/blog/creating-self-signed-wildcard/.

Create the certificates

  1. Download and install the Windows 8.1 SDK (http://msdn.microsoft.com/en-us/library/windows/desktop/bg162891.aspx).  You only need to install base component "Windows Software Development Kit" to get the makecert.exe application.  You can install this on the server or local development machine which later requires exporting the certificates.
  2. Open a command line with administrative privileges.
  3. Run "C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" -n "CN=My Development Root CA,O=My Company Name,OU=Development,L=MyCity,C=US" -pe -ss Root -sr LocalMachine -sky exchange -m 120 -a sha1 -len 2048 -r
  4. This will create and install a root authority certificate in your local Trusted Root Certification Authorities certificate store.
  5. Run "C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" -n "CN=*.mydomain.com" -pe -ss My -sr LocalMachine -sky exchange -m 120 -in "My Development Root CA" -is Root -ir LocalMachine -a sha1 -eku 1.3.6.1.5.5.7.3.1
  6. This will create and install a wildcard certificate in your local Personal certificate store.

Export the certificates to the server

  1. If you've performed the previous steps on your server, skip to step 10. Otherwise continue to export the certificates to your server.
  2. Open the Certificates Management Console (Windows key and search for "certificates"
  3. Open the Trusted Root Certification Authorities folder and right click your "My Development Root CA" certificate.
  4. Select "All Tasks > Export ..".
  5. Select "Yes, export the private key".  
  6. Click Next and assign a password to the export file.  Choose a location and save the file.
  7. Copy the file to your server.
  8. Repeat the export process for the wildcard certificate in the Personal certificates folder.
  9. Repeat steps 1-9 but select "No, don't include the private key" to get certificate exports necessary for SharePoint.
  10. Now open the Certificates Management Console on the server.
  11. Right click the Trusted Root Certification Authorities folder and select Import
  12. Find the exported root certificate, import it and enter the password.
  13. Repeat the import process for the Personal folder and choose the wildcard certificate.

 Configure IIS and SharePoint

  1. Open the IIS Manager on the server and select the SSL web application.
  2. Right click and choose Bindings...
  3. Select the port binding and choose Edit.
  4. Select the wildcard certificate from the dropdown SSL list.
  5. OK and save.
  6. Open a browser on the server and navigate to SharePoint Central Administration.
  7. Go to Security > Trust Relationships.
  8. Create a new item and choose the wildcard export file without the private key.
  9. Create another trust item with the root certificate export file without the private key.

Sep 4, 2014

SharePoint 2013 - slow page load

There can be a huge number of reasons for a SharePoint page to load slowly:  that's where the Developer Dashboard comes in handy.

How to fix your slow page:

  1. Activate the Developer Dashboard from Powershell
  2. Click on the icon to open the Developer Dashboard
  3. Refresh the page
  4. Click the page URL in the dashboard
Check SQL Queries 

SQL queries are the first reason for a slow page.  A blank page will only have around 5 queries.  If you have more than 10 queries, go to the SPRequest panel to see what requests are creating all the queries.  Every webpart will need it's queries, but the navigation system can automatically create hundreds of requests.

Configure navigation properly

The default navigation settings that show all subsites create lots of requests, even if metadata managed navigation is turned on.  Go into the navigation settings and hide every site navigation link, even if they aren't currently shown on the page.  Then refresh and check the SPRequests to see if it's decreased.

Jun 17, 2014

How to change your display language in SharePoint Online / Office 365 / OneDrive

There are three settings which affect the display language in SharePoint Online.  Here is the order of preference from highest to lowest:
  1. The user language preferences in a SharePoint Online user profile
  2. The browser language preferences in FireFox or Internet Explorer
  3. The language settings for a particular site.
 In order for a language to be selected, it must be activated in:
  • Browser language preferences
  • Site language settings

Setting the user language preferences in SharePoint Online is optional.  In addition, SharePoint Online can take several minutes to update the changes to the User Profile language preferences.

Examples:
  1. User profile preferences: DE
  2. Browser preferences: ES,EN,DE
  3. Site language settings: ES, DE
The language displayed would be DE (German) because it is the first and only language available in the User Profile.

Another example:
  1. User profile preferences: ES,EN
  2. Browser preferences: EN,ES
  3. Site language settings: EN
The language displayed would be EN (English) because it is the only language available in the site.

Change all user's default timezone setting for their MySite in SharePoint Online

In order to change the default timezone setting for the MySite in SharePoint Online:

1. Connect to SharePoint Online with an administrative account.
2. Go to the administrator's MySite.
3. Select Site Configuration from the menu.
4. Select Regional Settings from the Site Configuration screen.
5.  Choose the desired default timezone.  Click OK.
6. Done! All other users will inherit this default timezone.


To confirm the change:
1. Connect to SharePoint Online with a regular user account.
2. From the user name dropdown menu, select "About me"
3. From the user profile screen, click on "Edit profile".
4. Click on the three dot menu and select "Language and region"
5. In the section "Region", change the radio button "Choose your settings" from "Always use the regional settings defined by the site administrators" to "Always use my personal settings"
6.  Confirm that the default timezone in is the one chosen by the site administrator.
7.  Cancel out from the screen to leave the default setting.

Source: http://community.office365.com/en-us/f/148/t/175534.aspx

Feb 3, 2014

Problems configuring SharePoint 2013 on Windows Server 2012

Problems I ran into configuring SharePoint 2013 on Windows Server 2012:

1. Prequisite installer gets stuck in reboot loop configuring the server roles

 Solution: Install the prerequisites manually.  Note that AppFabric must be specially installed and configured by the prerequisites installer.
 http://blogs.technet.com/b/meamcs/archive/2012/12/26/install-and-download-sharepoint-2013-prerequisites-offline-manually.aspx

2. An app won't deploy from Visual Studio 2013

  Solution: Configure everything necesarry for local app deployment, including an entry in your DNS or hosts file for "apps.mydomain.local".
http://msdn.microsoft.com/en-us/library/fp179923(v=office.15).aspx#SP15appdevonprem_bk_configure

3. Deploying sandbox features with activation events gives error "An unknown exception occurred while executing a sandboxed code solution request in the worker process."

  Solution: Don't install SharePoint 2013 on a domain controller.  If you must because you have an all-in-one dev box, activate Verbose trace log level for the SharePoint Foundation > Sandboxed Code Service, restart IIS and the  SharePoint User Code Host service.  Problem solved.

http://spvee.wordpress.com/2013/08/14/sandboxed-solution-on-sharepoint-2013-with-domain-controller-worked/