Monday, February 27, 2017

SharePoint 2010 - PowerShell Content Database Backup


“This post details the steps for backing up the content database of a SharePoint site through PowerShell.   view the steps for backing up a content database through Central Administration.”
PowerShell provides a means to backup data within SharePoint through the following command:
Backup-SPFarm -Directory [Path] -BackupMethod [Full|Differential] -Item [BackupItem] -Verbose -Percentage [Percentage]
Further information on each of the parameters in this command are outlined bellow.


Directory

The Directory parameters specifies the path where the backup will be generated.  This can either be a UNC path or a location on the server.   “You don’t need to enter the spbr* folder name as this will be auto generated”
BackupMethod
The backup method parameter details the type of backup that will be performed.  This can either be Full or Differential:
  • Full - backs up the selected content with all history
  • Differential - backs up all changes to the selected content since the last full backup
  • Item

    The item parameter specifies the component within the farm that will be backed up.  If the item has a unique name you can use just that, however, if it doesn’t then you will need to us the path to the item within the farm.In order to get the path to the item you can use the following command:
    Backup-SPFarm -ShowTree
    This will list the tree structure of items within the farm.  In my experience the path to a content database within the farm is in the following format:
    “Farm\Microsoft SharePoint Foundation Web Application\[Site Name]\[Content Database Name]”

    Verbos

    This parameter is optional.  The verbose parameter provides more information about the operation being run.

    Percentage

    This parameter is optional.  The percentage parameter can be used to report progress about the operation at defined percentage intervals.

    SharePoint 2013 - Timer job not updating after re-deployment

    SharePoint 2013 - Timer job not updating after re-deployment

    When deploying a change to an existing timer job you need to restart the SharePoint Timer Job (owstimer.exe) service before the changes will be applied.
    This can be achieved through:
    net stop SPTimerV4
    net start SPTimerV4

    Wednesday, February 15, 2017

    How to get current user group collection through Rest api in SharePoint 2013

    <script type="text/javascript">
        $(document).ready(function () { getCurrentUser(); });
        function getCurrentUser() {

            $.ajax({
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/CurrentUser",
                method: "GET",
                headers: { "Accept": "application/json; odata=verbose" },
                success: function (data) {
                    getCurrentUserGroupColl(data.d.Id);
                },
                error: function (data) {
                    failure(data);
                }
            });

        }
        function getCurrentUserGroupColl(UserID) {
            $.ajax
            ({
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + UserID + ")/Groups",
                method: "GET",
                headers: { "Accept": "application/json; odata=verbose" },
                success: function (data) {
                    /* get all group's title of current user. */
                    var results = data.d.results; var InnrHtmlgrp = "<ul>";
                    for (var i = 0; i < results.length; i++) {
                        lstgrp += "<li>" + results[i].Title + "</li>";
                    }
                    $("#bindGroup").append(lstgrp + "</ul>");
                }
            });
        }
    </script>
     
          <div id="bindGroup"></div>

    Office 2013 breaks Sharepoint 2010 – An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown

    Solution 1:

    Uninstall your office 2013

    Solution 2:
    I have Office 2013 installed on my Server 2014 and after installing Sharepoint 2010 when I tried to configure Central Administration, I get the following error:
    Failed to create the configuration database.An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown.  Additional exception information: Failed to call GetTypes on assembly Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Could not load file or assembly 'Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.Office.InfoPath,

    Solution :

    Remove the following folders from the path

    C:\Windows\assembly\GAC_MSIL

    Policy.14.0.Microsoft.Office.InfoPath
    Policy.14.0.Microsoft.Office.InfoPath.Client.Internal.Host
    Policy.14.0.Microsoft.Office.InfoPath.FormControl

    Re-run the Configuration wizard

    Tuesday, January 17, 2017

    16 Hive Folder in SharePoint 2016


    In this article we will learn about the 16 hive folder in Microsoft SharePoint 2016. The 16 hive folder gets created while you install SharePoint 2016. It includes several important files to effectively support SharePoint.


    Following is the location of 16 Hive folder –

    C:\Program Files\Common files\Microsoft Shared\Web Server Extensions\16


    ADMISAPI :

    It includes Central Administration soap services. If this directory gets altered, remote site creation as well as all other methods that have been exposed in the service will function incorrectly.


    Bin :

    This directory includes all core binary files and utilities that are deployed by SharePoint Services.


    Client :

    This directory includes files used for creation of Office apps.


    Config :

    This directory includes files used for extending IIS Web sites with SharePoint Server. If in any case, any change is made in this directory or its contents, web application will malfunction.


    GAC :

    This folder contains following –

    Microsoft.SharePoint.Client.Runtime.Portable.Resources.dll

    Microsoft.SharePoint.Client.Runtime.Resources.DLL


    HCCab :

    This directory includes a complete set of cab files that includes content information deployed by SharePoint help system.


    Help :

    This folder contains the html help file (.chm) that is deployed by configuration wizard.


    ISAPI :

    This directory contains standard Web Services for SharePoint besides the resources & configuration files that are used by the web services.


    Logs :

    This folder provides all SharePoint related logs


    Policy :

    This directory includes Server policy files of SharePoint 2016


    Resources :

    This directory includes core.resx file that allows creating SharePoint language packs.


    Template :

    It includes core web site functionality such as configurations, features, templates, and entire resources of a web site.


    UserCode :

    This directory includes all files that are used for supporting sandbox solution.


    Web Clients :

    It contains files pertaining to Client Object Model.


    Web Services :

    This is the root directory for hosting SharePoint back-end Web services.