Wednesday, October 22, 2014

Publishing Save/Close not working



Error
An unexpected error has occurred.
Correlation ID: e3c9c2a2-87b4-40d2-b283-a9ad0eb50541
Date and Time: 10/22/2014 8:44:07 PM

Go back to siteGo back to site

Solution Steps:

$web = get-spweb "http://servername/sites/sitename"
$correctId = $web.Lists["Pages"].ID
$web.AllProperties["__PagesListId"] = $correctId.ToString()
$web.Update()
$web.AllProperties["__PublishingFeatureActivated"] = "True"
$web.Update()

SharePoint 2010 Error – You must specify a value for this required field

One issue that come up when using custom master pages is this error when editing a Team site page and then trying to save the it.
Image
All that causes this is simply a Place holder missing from the Main area of your master page. Even if you’ve moved it to a asp:Panel and declared it as false at the bottom of your master page you’ll still get the error. All is needed is to move content place holder <asp:ContentPlaceHolder id=“PlaceHolderPageTitleInTitleArea”runat=”server”></asp:ContentPlaceHolder> within the s4-bodyContainer div , within the s4-ca div seems to work best. Save the master page and that’s that no more irritating message.
You’ll notice this adds the page title to your master page you will either need to style it, place it in the area you want to display this or hide it if you don’t want to display it

Friday, October 17, 2014

SharePoint User Profile Service Migration from SharePoint 2010 to SharePoint 2013

Identify User Profile Service Databases -

    • User Profile Service Application_ProfileDB_ID
    • User Profile Service Application_SocialDB_ID
    • User Profile Service Application_SyncDB_ID
Note : Managed Metadata Service must be migrated before mingrating user profile service

  • Taking Back Ups of the Identified Databases 
    • Log in to you SQL Management Studio and take backups of the above mentioned Databases (good practice is to make them read only before taking backlups -> right click->properties->option->set read only)



    • Right click on the DB and select Back up - add the path you want the back ups to be stored 



                                                                             01



02

  • Exporting the Encryption Key
    • In the Server where User profile Service is currently running opem CMD and go to "%Program Files%\Microsoft Office Servers\14.0\Synchronization Service\Bin\"
    • Enter “miiskmu.exe"
    • Select export key and click next
    • Enter your farm admin account details and domain and next.
    • Set the path where the key should be exported
    • Click Export

  • Restoring Databases in the new SQL server

      • Copy the backups to the new SQL server ( Its good to have in the same machine while restoring)
      • Open SQL management studio in the new SQL server
      • Check Device, Select the Paths of the Databases and click OK

                                                                                                             03



    • Creating User Profile Service and Mounting The Databases
      • Before Creating the Service Application, User Profile Service in stance should be started
        • Central Administration -> Manage Services on server -> Start User Profile Service

       

      •     Create new Application Pool for user profile service 
                             New-SPServiceApplicationPool -Name  UserProfileServiceAppPool 
               - Account Domain\Username

                 $applicationPool = Get-SPServiceApplicationPool 
               -Identity 'UserProfileServiceAppPool'
                                                                             

        •    Create User Profile Service, using the above application pool and the migrated Databases
                            $UserProfServ = New-SPProfileServiceApplication 
                -Name "User Profile Service Application" 
                  -ApplicationPool $applicationPool 
                  -ProfileDBName "Profile DB Name" 
                  -SocialDBName "Social DB Name" -ProfileSyncDBName "Sync DB Name"


      • Import Encryption Key
        • Save the Exported encryption key in the following location in the application server "c:\\Program Files\Microsoft Office Servers\15.0\Synchronization Service\Bin\"
        • Open CMD and go to "%Program Files%\Microsoft Office Servers\15.0\Synchronization Service\Bin\"
        • Run the following command
          • miiskmu.exe /i c:\\Program Files\Microsoft Office Servers\15.0\Synchronization Service\Bin\keyname {0E19E162-827E-4077-82D4-E6ABD531636E}
                                    Note : GUID is always the same 

      Tuesday, July 1, 2014

      Adding Delimiter between Reapting Table Fields (aka Double Eval)

      I have been working on a problem where Im attempting to capture a merged field from a Repeating Table (infopath form) and add a delimiter between each entry.  This is a Webform.
      The purpose of adding the delimiter is so that later on from sharepoint I can export to Excel for reporting purposes.
      Anyway the function I know Im supposed to use is the Eval function (actually it is supposed to be a double Eval function). 
      The structure looks like this
      eval(eval(group5, 'concat(../../my:MainTable/my:group5/my:Unit, ";")'), "..")
      This actually does work, but the problem its not cycling through the data, its just taking the first field and each time you add a new row it just adds the first entry again.
      for example
      If the first field is dog
      the second field is cat
      and the third field is bird
      it comes out dog;dog;dog;
      It basically ignores the second and thrid entry as if its ignoring the double eval.
      Can anyone see what Im doing wrong with this double eval?

      Help URL Video: https://www.youtube.com/watch?v=ij2KqMH8FCU 

      Monday, June 23, 2014

      Common Error: The site is not valid. The 'Pages' document library is missing.

      The site is not valid. The 'Pages' document library is missing.
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
      Exception Details: Microsoft.SharePoint.Publishing.InvalidPublishingWebException: The site is not valid. The 'Pages' document library is missing.
      The interesting piece here is that the Pages library indeed existed but could not be found.
      Background Information
      To understand this we need to look into how the Publishing feature find the Pages library in a Publishing site. As the Pages library does not need to have the name "Pages" - e.g. in German version it has the name "Seiten" SharePoint does not search for the Pages library by name.
      Instead the Publishing feature stores the unique ID of the Pages library in the __PagesListId property which resides in the property bag of the publishing site.
      The above listed error will occur if the value stored in the __PagesListId does not match the ID of the actual Pages library.
      What can cause this problem?
      Honestly: I don't know. I have not managed to forcefully cause such an inconsistency - if one of you has repro steps, please post a comment here!
      How to fix the problem?
      To fix the issue it is required to update the value of the __PagesListId property value to match the ID of the Pages library.
      This can be done (e.g.) through the following Powershell script:


      $web = get-spweb http://site-collection/path-to-affected-site
      $correctId = $web.Lists["Pages"].ID
      $web.AllProperties["__PagesListId"] = $correctId.ToString()
      $web.Update()

      Tuesday, March 25, 2014

      SharePoint: Adding hyperlinks to document libraries

      Sometimes you have external content that you would like to make available from your document library without uploading a file. Examples include documents in other SharePoint sites or libraries, and even links to other web pages including SharePoint pages and external web sites.

      Turns out SharePoint already has this built-in, just well hidden. There is a built-in Content Type called "Link to a Document". Just add this to your library and then just click the "New" dropdown and select "Link to a Document"! It will simply ask you for a document name and url. You can supply a URL to anything that starts with "http://", including both SharePoint documents and external web pages. It does not support a link to a network share such as "\\myfileserver\folder1\somedoc.doc".
      1. Display your library (Example: Shared Documents)
      2. Click Settings and Library Settings
      3. Click Advanced Settings
      4. Check "Allow management of content types" and then OK
      5. In the Settings page scroll down to Content Types and click "Add from existing site content types"
      6. Select "Link to a Document", click Add and then Click OK
      7. Go back to your library and click the New dropdown and select "Link to a Document"
      8. Enter a display name (Document Name) and the URL (must start with http://) and click OK
      So how does it work? The Content Type has a template that is an ASPX page that contains a server side control named SharePoint:UrlRedirector. When this page is rendered it simply redirects to the address listed in the items URL property. Also experiment with adding these built-in content types to your library:
      • Basic Page
      • Web Part Page
      • Dublin Core Columns (Do a web or wikipedia.com search for "Dublin Core")
      • Picture
      You can also add customized folders to the New dropdown. See here. Need to add custom columns / meta data to any of the above? Just create a new Content Type based on one of the above and add it to your library. See here.

      Note:
      First Enabled "SharePoint Server Publishing Infrastructure" features under in Site Action --> Site Settings --> Site Collection Administration

      Wednesday, March 19, 2014

      Intermittent InfoPath Forms Services Error

      No errors were logged in Event Logs. We have identified the root cause of the problem to be connectivity with SharePoint User Profile web service as we are using it to populate the properties of logged-in user at form-load.
      On the other hand, this seems to be an issue only in a specific environment. So, we wanted to check the settings on the environment.
      Resolution Steps:
      1) Made sure all the data connection files have the environment specific List GUIDs, URLs and so on
      2) Made sure all the settings related to InfoPath Forms Services under Central Admin are proper: Enable web service proxy, Enable cross-data connections, Disable Anonymous access
      3) Made sure all the relevant user profiles are properly imported under SSP
      4) Made sure that the authentication Loopbackcheck registry entry is disabled on the WFE server
      Disable the authentication loopback check
      Re-enable the behavior that exists in Windows Server 2003 by setting the DisableLoopbackCheck registry entry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa registry subkey to 1. To set the DisableLoopbackCheck registry entry to 1, follow these steps on the client computer:
      1. Click Start, click Run, type regedit, and then click OK.
      2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
      3. Right-click Lsa, point to New, and then click DWORD Value.
      4. Type DisableLoopbackCheck, and then press ENTER.
      5. Right-click DisableLoopbackCheck, and then click Modify.
      6. In the Value data box, type 1, and then click OK.
      7. Exit Registry Editor.
      8. Restart the computer.
      5) Made sure the alternate access mappings or managed paths are not breaking the web service calls in the interim
      None worked. Finally, we have added a host file entry on the WFE server (we have only one WFE in our case) to point to its own IP, did a IIS reset  and it worked.
      I have actually found this resolution on one of the blogs:
      If the WFE servers are load-balanced, we need to add a host file entry on WFE pointing to its own IP on each of WFE. This is to deal with a known issue with InfoPath browser forms; all browser form calls to SharePoint web services will be made to the current machine that invoked the form.

      -----------------------------------------------------
      I recently came across this baby quite frequently when developing a form that used the user profile web service to automatically populate a ‘contact information’ section. For step by step instructions on how to achieve this, check out Itay Shakury’s terrific blog here: http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx
      Anyway, despite this solution working for me on a single server environment, when I migrated it to a multi-server farm (NTLM) it intermittently stopped working. Although it didn’t seem necessary as the web service was a local resource rather than an external one; I looked into UDC files and Administrator approved form publishing. The authentication token was obviously being lost between serving the form and making the request to the web service because I was seeing these kinds of errors in the logs:
      04/15/2008 17:01:05.39 w3wp.exe Forms Server Forms Services Runtime – Data C 82fy Warning The following query failed: GetUserProfileByName (User: ***, Form Name: ***, IP: , Request: *** Form ID: urn:schemas-microsoft-com:office:infopath:***, Type: DataAdapterException, Exception Message: The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized.)
      After some digging through the server logs it became clear that the web service request was being sent via the load balancing server which was assigning it to 1 of the 3 MOSS servers in the farm. If the server that was serving the form got the request, the form worked perfectly and displayed the user details but if another server received the request then the error above was displayed because the server had no idea where the original request was from.
      So after playing around with the web service data connection for a while- trying to use localhost or the server name instead of the host header (which Forms Services doesn’t like), I finally added a simple entry to all 3 server hosts files and mapped the host header name to 127.0.0.1. This ensured that once a server was assigned a request by the LB, any secondary requests to a farm resource would then be served by the same server (localhost) instead of being directed back to the LB.