Sunday, September 4, 2016

How to Hide the Timeline in the Task List of SharePoint 2013/2016

Requirement: Hide timeline from SharePoint 2016 task list
sharepoint task list hide timeline
Solution: Here is how you can hide the timeline in SharePoint 2013/2016 task lists.
  1. Go to the Task List, Click on List Tab and then click on "Modify View" button from the ribbon.
  2. In the Edit view page, scroll down and expand the 'Style' section.
  3. Under the Style selection, Uncheck the checkbox 'Show timeline above the view'
  4. click on 'OK' button to save changes.
Here is the Result:
sharepoint 2013 task list hide timeline

Alternatively, You can edit the page, Edit List view properties, and uncheck "Show Timeline" Checkbox to hide timeline from SharePoint tasks list.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, September 1, 2016

Backup-Restore All SharePoint Databases in SQL Server using PowerShell

Requirement: We planned to move our SharePoint's SQL database to a different server. So, we had to backup and restore all SharePoint databases from one SQL Server 2012 instance to another.

Solution:
Here are the steps at high level to move SharePoint from one SQL Server to another:
  1. Get a list of all SharePoint databases
  2. Backup all SharePoint databases from the source SQL Server
  3. Restore the backups to the target SQL server instance
  4. Change the SQL Alias in SharePoint Server to point to the new server.
Step 1: Get all SharePoint databases
#Get All SharePoint Databases and form an Array
Get-SPDatabase | Select -ExpandProperty Name | foreach { $Databases+= $_+"," }

#Export to a txt file
$Databases > databases.txt
This script gets you a list of all SharePoint databases, including configuration database, content databases and service application databases to a comma separated string. Lets take that string and give it to our backup script.
Tips: If you want to get all Content databases, use: Get-SPContentDatabase | Select -Expandproperty Name

Step 2: Backup All SharePoint Databases:
Before taking backup of all SharePoint databases, make sure you set the site(s) to Read-only mode (or set the database to Read-only in SQL Server) in order to avoid any data inconsistency issues.

Here is the PowerShell script to backup all Databases from SQL Server:
#Import SQL PowerShell module
Import-Module SQLPS –DisableNameChecking

#Configuration parameters
$SQLInstance="Cre-SQL-001"
$BackupPath="F:\Backup\"

#Array of Database names, Comma separated
$DatabaseColl="StateService_d73ac2ad313a41ba83d457bfb78cb4f3,Secure_Store_Service_DB_c13a71870bad4decb6f7582d9e26f46a,WordAutomationServices_e290fc12c8ee4ce09c38ba7fc8f089c9,Social DB,Bdc_Service_DB_f937be05fe5f48158d4895b6f2bb9674,WebAnalyticsServiceApplication_StagingDB_9efa01f9-ce98-4e4e-9e2d-ecfc9e19fc79,SharePoint_Config_2010,PerformancePoint Service Application_c1a8062656434a24a9c53f05fc8144f7,Search_Service_Application_CrawlStoreDB_76166d368e4a4ef58aabf8df57d7c670,Search_Service_Application_PropertyStoreDB_1fc75775ee894fd2aa0c4d1e7c75f0c7,Application_Registry_Service_DB_8e93a305ea904c81a34a3dd205265fc7,SharePoint_AdminContent_e0021dbb-cc00-4b58-a16d-9c4c481228ff,WSS_Content,WSS_Content_KM,WSS_Content_MySites,Search_Service_Application_DB_bfdf7354e7f84b1281121c7bdca7b43f,Managed Metadata Service_ff52c4f0cd504d938cd1b3dc9ef9ae8b,Profile DB,WSS_Logging,Sync DB,WebAnalyticsServiceApplication_ReportingDB_894b25ce-a2ba-4c7c-885e-08b3924deec8"

#Convert comma separated into an Array
$DatabaseNames = $DatabaseColl -split ","

#Backup Each Database
Foreach($DBName in $DatabaseNames)
{
  write-host "Backing up the database: $($DBName)"
  Backup-SqlDatabase -ServerInstance $SQLInstance -Database $DBName -BackupFile "$($BackupPath)\$($DBName).bak"
}

Step 3: Restore all databases to the target SQL Server instance
Copy all backup files from the source server to the target and then, use the below PowerShell script to restore SQL Server databases in bulk. Make sure the original location (as in the source database server) do exists in the target server.

PowerShell script to restore SQL Server databases in bulk:
#Import SQL PowerShell module
Import-Module SQLPS –DisableNameChecking

#Configuration parameters
$SQLInstanceName="Cre-SQL-002"
$BackupPath="E:\Backup\"

#Get all Backup files
$BackupFilesColl = Get-ChildItem –Path $BackupPath | where {$_.extension -eq ".bak"}

#Iterate through each backup file
Foreach($BackupFile in $BackupFilesColl)
{
 #Get the full path of the backup file
        $DatabasePath = $BackupPath + '\' + $BackupFile

 #Frame the Database Name
        $DatabaseName = $BackupFile.ToString().Replace(".bak", "")

 #Restore the database
 write-host "Restoring Database: $($DatabaseName)"
 Restore-SqlDatabase -ServerInstance $SQLInstanceName -Database $DatabaseName -BackupFile $DatabasePath
}
Backup-Restore All SharePoint Databases in SQL Server using PowerShell

Step 4: Change SQL Server Alias to Point your New SQL Server:
and as a final step, change your SQL Alias from SharePoint servers to point new SQL server instance. Here is my post on configuring SQL server alias: How to Create SQL Server Alias for SharePoint. Do IISReset once done!

These scripts can be used in scenarios, such as:
  • During SharePoint migrations, where you may be taking all SharePoint databases to a new SQL Server instance.
  • When you have to move SharePoint databases from a Single standalone SQL Server to a highly available cluster, or SQL Server AlwaysOn cluster.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, August 5, 2016

Configuring Web Application User Policy in SharePoint 2013 / 2016

A SharePoint web application may have hundreds or thousands of site collections. Providing same access to all of those site collections for a set of users can be difficult task, isn't it? So here is where SharePoint Web application Policies comes to play. Consider these practical scenarios where:
  • Your SharePoint search crawl account needs read access on all site collections.
  • You'll have to provide Read access to all site collections to "Auditors" group of your organization
  • You may want to provide read access to all users for an Intranet web application.  
  • Your CIO wants to get Full control on all site collections. 
  •  Your fellow farm administrator needs full control over all site collections on the SharePoint 2013 web application, etc.
Web application user polices are the comprehensive way to apply to permission to all site collections in a web application. Web application policy either grant or deny permissions to a set of users. By default, a web application has these four permission policy levels predefined:
  • Full Control
  • Full Read
  • Deny Write
  • Deny All
In fact, the Web application User policy is basically a mapping between Active Directory user or group and certain Web Application Level Permission policy. 

Permissions applied using web application User Policy simply supersedes all other permissions applied at the individual site collection level. E.g., if a user has Read access to some site collections, granting the Full Control permission gives the user "Full Control" all site collections within the entire web application. With web application level permission policies you can control centrally manage access to all content in the web application without individually adding site collection administrators on each site.

Deny permission level takes precedence over any existing permissions applied. E.g. Applying Deny All to a user prevents any and all access to a web application and all its site collections. BTW, Deny policy at web application level is the only way to block someone's access to SharePoint.

To access the user policy for a web application using Central Administration:
  1. Open SharePoint 2016/2013/2010 Central Administration site as a Farm Administrator
  2. Click Application Management >> Select Manage Web Applications.
  3. Select your target web application >> Click the User Policy button from the ribbon.web application policy in sharepoint 2013
  4. This page lists all user policies created for the web application. Usually, you'll find the search service application crawl account here with full read access user policy to granted. web application user policy sharepoint 2016
How to add new Web application user Policy:
To add a new policy, click the Add Users link. Then perform the following steps:
  1. From the Policy for Web Application dialog box, click on "Add Users" link. 
  2. Select All Zones for the web application and click on Next (You can optionally select a single zone such as Internet and limit the policy with the zone)web application policy sharepoint
  3. Enter one or more user account names or security groups. You can enter multiple users or security groups.
  4. Select the permission policy levels that you want to apply. You can add custom permission policy levels from "Permission Policy".
  5. Optionally, you can select the "Account Operates As System" check box, which means if a user creates or modifies any item in this web application, the Created By and Modified by entries will be shown as: System Account.Add user to web application user policy sharepoint 2016
  6. Click Finish to save your changes. This ensures consistent security permissions across site collections of a web application.
By providing permissions policy at the web application level, Our purpose is to control who has access to the content within the site collections that are associated with the web application.
 
Edit Existing User Policies:
To edit any of the existing policy:
  • Click on the corresponding "Display Name" value (or you can check the policy and click the Edit Permissions Of Selected Users link). 
  • In the edit policy dialog box, adjust any required settings, such as permissions and click on Save once done..

To Delete a Web Application User Policy:
To remove a user policy, simply select the policy and click on "Delete Selected Users" link, Confirm when prompted.

As a best practice, use Active directory security groups in SharePoint web application user policies as adding individual users triggers search crawl to trigger. This procedure applies to all version of SharePoint SharePoint 2016, 2013, 2010, and 2007!

Related post: PowerShell script to Add Web Application User Policy in SharePoint

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, August 4, 2016

How to Add a New User Group in SharePoint 2016

It is best practice to assign permissions to groups and add users to those groups rather than granting permission directly. If the default groups do not suit your needs, you can create new groups.

Lets see how to create new SharePoint 2013 groups.
Make sure you logged in as a site collection administrator or Site owner to create a new group in SharePoint!

Create a New Group in SharePoint 2016:
  • Login to the site where the group needs to be created
  • From the home page, click on Settings gear icon and choose Site Settings from the drop-down menu.
  • Click on Site Permissions under users and permissions section.
  • Click on Create Group icon from the ribbon.
  • Give a Name of the group and Description on the Create group page
  • You can assign group owner or add an additional group owner Optionally. The owner will be able to edit group membership. Select who can view membership of the group and who can edit group members.
  • Select the appropriate setting for membership requests.
  • Select the appropriate permission levels(s) for the group. Any permissions selected here will apply to the entire site.
The new SharePoint group will be created and you will be taken to the People and Groups page where you can start adding users to the group created.

Related post: How to create a SharePoint group using PowerShell

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, July 15, 2016

How to Change Server Role after Installing SharePoint 2016

One of the exciting new feature in SharePoint 2016 is Minrole. It defines server's role in the SharePoint 2016 farm, and makes sure all necessary services are running in that server! SharePoint 2016 comes with below Minroles:
  1. Single Server Farm
  2. Front End
  3. Application
  4. Distributed Cache
  5. Search
  6. Custom
Change MinRole in  SharePoint 2016:
Server roles are selected during the installation of SharePoint 2016 or when you join a server to your farm. Based on the Server role selected, certain services will get activated on selected servers. What if you want to change the server role after SharePoint has been provisioned?  With the introduction of MinRoles in SharePoint 2016, its fairly straightforward to switch server roles between anyone among them:
  • Go to SharePoint 2016 Central Administration >> System Settings 
  • Click on Convert server role in this farm under Servers
How to Change Server Role in SharePoint 2016
Now, It takes you to the "Role conversion" page, where you will see the options for all Minroles. Pick the new role from the dropdown and click Apply,  Your server will be changed to New role!
swith server role after provisioning SharePoint 2016
You can't combine two or more MinRoles in one server. However, You can use the Custom role  to achieve the same! To check roles assigned to servers in the farm, Go to: SharePoint 2016 Central Administration >> System Settings > Manage servers in this farm. This page lists all servers and their roles in the farm.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...