Quantcast
Channel: SharePoint Diary
Viewing all 1058 articles
Browse latest View live

SharePoint 2013 Service Accounts List, Permissions and Best Practices

$
0
0
Everyone have their own ways of setting up service accounts. Technically its possible to run every SharePoint service under ONE account, lets follow the least privilege principle best practice. 

SharePoint 2013 Service Accounts Naming convention:
When you are running with multiple SharePoint 2013 environments like Dev, Test and Production (Best Practice!) you can explicitly segregate the service accounts in their names. Such as: SP13_PROD_Setup.

Here is my list of SharePoint 2013 service accounts and permissions needed to setup, manage and administer SharePoint:

Account Name
Description
Rights
Managed Account?
SP13_Setup
The Setup account is used to perform the following tasks:
-SharePoint Installation
-Runs SharePoint Products Configuration Wizard
-Configure and manage the server farm, farm configuration wizard
Local Administrator on all the SharePoint Servers.

On the SQL Server
SecurityAdmin and DBCreator Server Roles. It needs DBO access on Content databases to run PowerShell, Which should be added later (Add-SPShellAdmin).
No
SP13_Farm

- Application pool identity for the SharePoint central Administration Web site.
- Database access account
-Runs SharePoint Timer Service.
Additional permissions automatically granted to the farm account on web servers and application servers that are joined to a server farm. Account needs to be in the local administrators group at the time of User Profile Provisioning!
Yes
SP13_Pool
The account is used to run the Web Application Pools
None
Yes
SP13_Services
Account is used to run the service applications
None
Yes
SP13_Crawl
The default content access account for the search service application
Read-only Access on all external sites.
No
SP13_UserProfile
The account used to Import user profile and provides synchronization between SharePoint and AD.
Replicate Directory Changes permission on the domain.
No
SP13_SuperUser
Cache account for web application super user account
Web application Policy Full Control
No
SP13_SuperReader
Cache account for web application super reader account
Web application Policy Full read
No
SQL_Admin
SQL Admin on the SQL Server. Used to install the SQL Server.
Local Administrator on the SQL Server
No
SQL_Services
service account for the following SQL Server services
None
No


Your service accounts must have Log on a service, Log on as a batch job, and Allow log on locally properties set to ON (By default these properties are ON, unless you have very tight security policies)

How to change SharePoint 2013 service account
Managed Accounts can be registered via Central Administration >> Security >> Configure managed accounts.  To configure service accounts as managed account, refer: Create New Managed Account in SharePoint 2013 Using Powershell

After setting up the managed accounts, you can start assigning to some services. Go to Central Administration >> Security >> Configure service accounts page to associate service accounts with SharePoint services, such as "Farm account".
how to change sharepoint 2013 service account
SharePoint 2013 change search service account
sharepoint 2013 change farm service account

To Create SharePoint Service Accounts in AD using PowerShell: http://www.sharepointdiary.com/2014/08/create-sharepoint-service-accounts-using-powershell.html
Important: All accounts must be a domain accounts! No local account can be used as SharePoint service account.
Depending on your organization's security policies, you may have to add/remove service accounts to this list. You may consider additional Service Application for services such as Excel Unattended Service, Visio, etc.
SharePoint 2013 service accounts reference in technet

Configure SharePoint 2013 Object Cache Super User, Super Reader Accounts

$
0
0
SharePoint 2013 object cache stores metadata about SharePoint Server objects like SPSite, SPWeb, SPList, etc. on the Web Front Ends. SharePoint features such as publishing, content query web part, navigation, search query box , metadata navigation, etc fetches data from object cache, instead of hitting SQL Server when data needs to be retrieved from SharePoint objects to optimize page rendering.

For the object caching to work properly in SharePoint, We need to perform below tasks:
  • Create user accounts for "Portal Super Reader" and "Portal Super User" in your active directory
  • Grant web application policy on these user accounts on web applications.
  • Associate super user and super reader user accounts to web applications
These accounts simulates a reader and high-privileged users. If these accounts are not configured, you’ll see entries in the Windows event log with ids: 7362, 7363:
Object Cache: The super user account utilized by the cache is not configured. This can increase the number of cache misses, which causes the page requests to consume unnecessary system resources.

Event ID: 7362: The super user account utilized by the cache is not configured

Step 1: Create user accounts for "Portal Super Reader" and "Portal Super User" in your active directory
Go to your active directory, create two user accounts. In my case, I've created these accounts in my domain: "Crescent" as:
  • SPS_SuperUser
  • SPS_SuperReader
I've used the below PowerShell script to create these accounts in  Active directory:
Import-Module ActiveDirectory -ErrorAction SilentlyContinue

#Set configurations
$AccountPassword = "Password1"
#Convert to Secure string
$Password = ConvertTo-SecureString -AsPlainText $AccountPassword -Force

$Domain = "YourDomain.com"
#Specify the OU
$AccountPath= "ou=SharePoint,DC=YourDomain,DC=com"

#Create Super Reader Account
$Account="SPS_SuperReader"
New-ADUser -SamAccountName $Account -name $Account -UserPrincipalName $Account@$domain -Accountpassword $Password -Enabled $true -PasswordNeverExpires $true -path $AccountPath -OtherAttributes @{Description="SharePoint 2013 Super Reader Account for object cache."}

#Create Super User Account
$Account="SPS_SuperUser"
New-ADUser -SamAccountName $Account -name $Account -UserPrincipalName $Account@$domain -Accountpassword $Password -Enabled $true -PasswordNeverExpires $true -path $AccountPath -OtherAttributes @{Description="SharePoint 2013 Super User Account for object cache."}

Step 2: Grant web application policy on Super User, Super Reader accounts on all web applications
After account are created, we have to grant permissions at web application level. Navigate to
  1. SharePoint Central administration >> Application Management >> Manage web applications.
  2. Select your web application >> From the ribbon, click on User Policy button.
  3. Click on "Add" button from the User policies page.
  4. From the zones list, select "All zones" and click on next.
  5. In the Add users page, Enter the Super Reader user name. Under Permissions, Select "Full Read" option and Click on Finish button.
Repeat these steps for Super user account as well. In the 5th step, Enter the Super User account and choose "Full Control" permission. We got to repeat this procedure for all of our web applications. So, lets automate with PowerShell.

PowerShell script to grant web application user policy on all web applications:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

Function Grant-UserPolicy($UserID, $WebAppURL, $Role)
{
#Get the Web Application
$WebApp = Get-SPWebApplication $WebAppURL

#Convert UserID to Claims - If Web App is claims based! Domain\SPS_SuperReader to i:0#.w|Domain\SPS_SuperReader
if($WebApp.UseClaimsAuthentication)
{
$UserID = (New-SPClaimsPrincipal -identity $UserID -identitytype 1).ToEncodedString()
}

#Crate FULL Access Web Application User Policy
$ZonePolicies = $WebApp.ZonePolicies("Default")
#Add sharepoint 2013 web application user policy with powershell
$Policy = $ZonePolicies.Add($UserID,$UserID)
#Policy Role such as "FullControl", "FullRead"
$PolicyRole =$WebApp.PolicyRoles.GetSpecialRole($Role)
$Policy.PolicyRoleBindings.Add($PolicyRole)
$WebApp.Update()

Write-Host "Web Application Policy for $($UserID) has been Granted!"
}

#Get all Web Applications
$WebAppsColl = Get-SPWebApplication
foreach($webApp in $WebAppsColl)
{
#Call function to grant web application user policy
Grant-UserPolicy "Crescent\SPS_SuperReader" $webapp.URL "FullRead"
Grant-UserPolicy "Crescent\SPS_SuperUser" $webapp.URL "FullControl"
}

This adds "Full Control" user policy to all of your web applications for the Super User account and "Full Read" user policy to Super Reader account. You can go back to Web application user policies page to verify that these accounts are added to web applications.

Step 3: Associate super user and super reader accounts to web applications
Once web application policies are created, We've to associate Super User and Super Reader accounts with Web applications either with classic STSADM or using PowerShell commands.

stsadm -o setproperty -propertyname portalsuperuseraccount -propertyvalue Crescent\sps_superuser -url "Web-app-url"

Same can be done with PowerShell as,
$WebApp = Get-SPWebApplication "http://web-app-url/"

$webApp.Properties["portalsuperuseraccount"] = "i:0#.w|Crescent\SPS_superuser"
$webApp.Properties["portalsuperreaderaccount"] = "i:0#.w|Crescent\SPS_superreader"

$WebApp.Update()
Lets use PowerShell to Add object cache accounts with all web applications:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get all Web Applications
$WebAppsColl = Get-SPWebApplication

foreach($webApp in $WebAppsColl)
{
#Update with your SuperUser and Super Reader Ids
$SuperReader = "Crescent\SPS_SuperReader"
#Convert to Claims ID
$SuperReaderID = (New-SPClaimsPrincipal -identity $SuperReader -identitytype 1).ToEncodedString()

$SuperUser = "Crescent\SPS_SuperUser"
$SuperUserID = (New-SPClaimsPrincipal -identity $SuperUser -identitytype 1).ToEncodedString()

#Set Super User and Super Reader accounts
$webApp.Properties["portalsuperreaderaccount"] = $SuperReaderID
$webApp.Properties["portalsuperuseraccount"] = $SuperUserID

$webApp.Update()
Write-host Object cache accounts updated for $WebApp.URL
}
On Publishing sites, object cache is turned ON automatically. Once its enabled at web application level, you can adjust object caching settings from "Site collection object cache " link under site collection administration settings .
Technet reference: Configure object cache user accounts in SharePoint Server 2013

Using SharePoint Designer to Edit Property Bags

$
0
0
Property bags are explained in my another article: Property Bags in SharePoint 2013 - Store, Retrieve Custom Configurations , In short: Property bag feature provides a convenient way to store and retrieve custom configurations, instead of having to store them in web.config files.

Usually property bag settings are managed programmatically with SharePoint object model code in C# ow with PowerShell. There is no user interface to view/add/edit/delete the property bags key-value, but SharePoint designer can be utilized to manage property bag settings in SharePoint at site level. Here is how:
  • Open your SharePoint site collection with SharePoint Designer
  • Click on the Site Options button from the top right hand corner of the ribbon
  • You'll be presented with a window to manage site’s property bag under "Parameters" tab.
  • From here, you can add, modify or delete properties.
property bag in sharepoint designer 2010
In SharePoint 2007, Its under: Site >> Site Settings >> Parameters tab!

Hide "Site Contents" Link from SharePoint 2013 Quick Launch Navigation

$
0
0
How to hide "Site Contents" link from SharePoint 2013 quick launch navigation?

Hide all site content from quick launch SharePoint 2013 with CSS
Edit your SharePoint page, Insert a "Script Editor" web part and add the below code in it. 
<style>
#sideNavBox a[href$="/_layouts/15/viewlsts.aspx"]
{
display: none;
}
</style>
To remove site content from quick launch of SharePoint 2013 sites, Add this CSS to master page, Or you can have it in Alternate CSS sheet.
Save and Publish your master page.

Remove site contents SharePoint 2013 (Not recommended)
If you want to remove "Site Contents" link permanently, You can: Click on "Edit Links" under Quick Launch, edit and remove the "Site Contents" link. Same can be done by: Go To Site Settings >> Quick Launch >> site content  >> click on edit icon >> Delete.

Related Post: How to Hide View All Site content & Recycle Bin Links in SharePoint 2010/MOSS 2007?

Tags: hide all site content from quick launch sharepoint 2013, remove site content quick launch sharepoint 2013 , hide all site content sharepoint 2013, hide view all site content sharepoint 2013, remove site contents from sharepoint 2013, hide site contents in sharepoint 2013, sharepoint 2013 hide site contents in quick launch, how to hide site contents in sharepoint 2013, hide site contents link sharepoint 2013, hide site contents on sharepoint 2013, hide site content from left navigation sharepoint server 2013, hide site contents sharepoint 2013, remove site contents sharepoint 2013, remove site content quick launch sharepoint 2013, hide all site content link sharepoint 2013

Create New Result Source for Federated Search using PowerShell

$
0
0
PowerShell script to Create new result source for Federated search:

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#create a new result source at Search Service Application
$SearchServiceApplication = Get-SPEnterpriseSearchServiceApplication
$FederationManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($SearchServiceApplication)

$SearchOwner = Get-SPEnterpriseSearchOwner -Level Ssa
$ResultSourceName ="Bing Search Result Source"

#For Site Level Result Source, Use:
#$SiteCollection = Get-SPSite $SiteUrl -ErrorAction SilentlyContinue
#$SearchOwner = Get-SPEnterpriseSearchOwner -Level SPSite -SPSite $SiteCollection

#Check if the Result Source is already exists
$ResultSource = $FederationManager.GetSourceByName($ResultSourceName,$SearchOwner)
if($ResultSource)
{
$FederationManager.RemoveSource($ResultSource)
}

# create a new result source
$Query = "{SearchTerms}"

$ResultSource = $FederationManager.CreateSource($SearchOwner)
$ResultSource.Name = $ResultSourceName
$ResultSource.ConnectionUrlTemplate = "http://www.bing.com/search?q={searchTerms}&format=rss&Market=en-us"
$ResultSource.ProviderId = $FederationManager.ListProviders()['OpenSearch Provider'].Id
$ResultSource.CreateQueryTransform($queryProperties, $query)
$ResultSource.Commit()

Write-host Result Source: $ResultSourceName has been created successfully!

Related post: How to Create Result Source in SharePoint 2013

How to Add HOST file Entry using PowerShell

$
0
0
Here is the nifty PowerShell script to add HOST file entry using PowerShell:
$HostFile = 'C:\Windows\System32\drivers\etc\hosts'

# Create a backup copy of the Hosts file
$dateFormat = (Get-Date).ToString('dd-MM-yyyy hh-mm-ss')
$FileCopy = $HostFile + '.' + $dateFormat + '.copy'
Copy-Item $HostFile -Destination $FileCopy

#Hosts to Add
$Hosts = @("intranet.Crescent.com", "Intranet", "mysite.crescent.com")

# Get the contents of the Hosts file
$File = Get-Content $HostFile

# write the Entries to hosts file, if it doesn't exist.
foreach ($HostFileEntry in $Hosts)
{
Write-Host "Checking existing HOST file entries for $HostFileEntry..."

#Set a Flag
$EntryExists = $false

if ($File -contains "127.0.0.1 `t $HostFileEntry")
{
Write-Host "Host File Entry for $HostFileEntry is already exists."
$EntryExists = $true
}
#Add Entry to Host File
if (!$EntryExists)
{
Write-host "Adding Host File Entry for $HostFileEntry"
Add-content -path $HostFile -value "127.0.0.1 `t $HostFileEntry"
}
}

Some Farm Products and patches were not detected on this or other servers - Fix

$
0
0
After patching a SharePoint 2013 Farm, Attempted running SharePoint Products configuration wizard and receive this error message:
"Error: Some farm products and patches were not detected on this or other servers.  If products or patches are missing locally, you must quit this program and install the required products and patches on this server before restarting this wizard. If products or patches are missing on other servers, you must install the required products and patches on the specific servers, and you may then click the Refresh button to perform the status check again."
Error: Some Farm Products and patches were not detected on this or other servers

Root Cause:
To enforce consistency, SharePoint 2013 checks installed product version automatically on running Products configuration wizard. If any server is missing a specific patch, You get this error message and SharePoint would not let the SharePoint Configuration Wizard to proceed.

Solution:
Install the missing patches on your SharePoint Servers and rerun this wizard!

But wait, in my case, I'm sure all patches are installed without error on all servers. I tried running the patch again and got "The upgrade is already installed on this system" error. I verified it via Control panel >> Programs and Features >> recently installed updates. Tried restarting each SharePoint server, Still SharePoint thinks I have not patched one of the server! Hmmm...

Finally, Found this solution: Run this PowerShell command from servers reported:
Get-SPProduct -local
This command refreshes the installed patch data. Triggering "Product Version Job" timer job also helps!

Tail: If you are very sure, You have patched all servers with similar installers, you can bypass the check by:
psconfig.exe -cmd installcheck -noinstallcheck

Reset to Site Definition via PowerShell in SharePoint

$
0
0
To Re-ghost customized SharePoint sites and pages, We use "Revert to Site definition" via
  • Site Settings >> under Site Actions section, click on Reset to site definition 
  • Choose a specific page or entire site. Click on Reset! .
Reset to site definition - what does it do?
Reset to Site Definition removes any customizations and reverts the file back to the version originally deployed via the Site Definition. Customized pages are stored in the Content Database (a copy with changes) and are called unghosted. When you reset, the customized copy gets deleted and the version on the file system (the Site Definition version) is used.

Reset to Site Definition via PowerShell
When you have to reset a Site or List to its definition in bulk, PowerShell can be utilized.
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

$WebURL ="https://intranet.crescent.com/sites/operations/us"

$web = Get-SPWeb $SiteURL
$web.RevertAllDocumentContentStreams();
$web.Update()
Lets do it for All sites under the site collection:
$SiteURL ="https://intranet.crescent.com"

#Revert all webs to site definition
Get-SPSite $SiteURL | Get-SPWeb | foreach-object {
$_.RevertAllDocumentContentStreams()
Write-Debug "Site Resetted: $($web.Url)"
}
 All customizations will be reverted once the operation completed.

Sorry, something went wrong - The file FILENAME is locked for exclusive use by USER

$
0
0
Problem:  End-Users receives error when trying to edit a file. "Sorry, something went wrong - The file FILE-URL is locked for exclusive use by USER-NAME"
Root Cause:
When users edit the document in client applications such as Microsoft Office, SharePoint places a locks and renews it for every 10 minutes to prevent other users from modifying it. This lock is released automatically when the client application is closed, or after 10 minutes.

Solution: 
But in some scenarios, lock retains due to reasons like: Client application crash, Network connectivity issues, etc.  So, the simplest solution would be wait for 10 minutes for the lock to expire. But if you want the lock to be released immediately, You can unlock it programmatically!

There is no UI to unlock the locked files - as we do have for Check-in Checked-out files. So, Here is my solution to unlock the locked files using PowerShell.
 Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Variables for Web and File URLs
$WebURL ="http://intranet.crescent.com/support/"
$FileURL ="http://intranet.crescent.com/support/T1Support/Reports/ServiceTickets.xlsx"

#Get Web and File Objects
$web = Get-SPWeb $WebURL
$File = $web.GetFile($FileURL)

#Check if File is Checked-out
if ($File.CheckOutType -ne "None")
{
Write-host "File is Checked Out to user: " $File.CheckedOutByUser.LoginName
Write-host "Checked Out Type: " $File.CheckOutType
Write-host "Checked Out On: " $File.CheckedOutDate

#To Release from Checkout, Ask the checked out user to Checkin
#$File.Checkin("Checked in by Administrator")
#Write-host "File has been Checked-In"
}

#Check if File is locked
if ($File.LockId -ne $null)
{
Write-host "File is Loked out by:" $File.LockedByUser.LoginName
Write-host "File Lock Type: "$file.LockType
Write-host "File Locked On: "$file.LockedDate
Write-host "File Lock Expires on: "$file.LockExpires

#To Release the lock, use:
#$File.ReleaseLock($File.LockId)
#Write-host "Released the lock!"
}
Don't forget to un-comment the lines 32-33 if you find your files are locked out.

How to Create Federated Search Results in SharePoint 2013

$
0
0
What is Federated Search in SharePoint 2013:
As its name suggests, Federated search combines search results from multiple search engines. Federated search allows you to consume search indexes created by search engines outside of SharePoint.

How Federated Search works in SharePoint 2013?
Federated Search basically uses the index created by an another search engine. When a search query  triggered from SharePoint, it is forwarded to an external search engine and SharePoint gets the result from that index, displays the results from all configured federated sources in a single page to allow users to view results from different sources. E.g. you can set up federated search to return content indexed by an external search engine like Bing, twitter, etc.  

When to use Federated search?
Federation comes to play when you can not crawl the data source. Federated Search only works with indexes compatible with OpenSearch 1.0/1.1. So, its compatible with other SharePoint farms - You can federate search across farms, YouTube, Bing, Twitter, Flickr, Technet, Wikipedia, etc. (Federated search is not compatible with Google yet - There are some workarounds however!)

How to Create Federated Search in SharePoint 2013 :

There are two steps involved in creating federated search in SharePoint 2013.
  1. Create a Result source for federated content source
  2. Create a query rule to include federated search results in SharePoint search results page
Step 1: Create a Result source for federated content source
Search Scopes are replaced with "Result Sources" in SharePoint 2013. It just defines where to look for results. E.g. Search for only documents, people, etc. at specific source such as farm, site collection or site level.

How to Setup Federated Search in SharePoint 2013:
Federated search can be configured either at site level or centrally from SharePoint central administration site. Its a good idea to configure federated search in SharePoint 2013 at Central Admin, so that it can be utilized globally.
  • Go to Central Administration >>  Application Management >> Manage service applications >> Select your  Search Service Application.
  • You'll be presented with the Search Administration page.
But wait! Here, I'm creating a result source at site level from search center site. Below steps are similar whether you are configuring federated search from Central admin or from a local SharePoint site. Lets configure SharePoint 2013 federated search with Bing at site level.
  • To start with federated search in SharePoint 2013, Navigate to Site settings >> Click on  "Result Sources" link under Search group.
  • From the Manage result sources page, click "New Result Source" link. SharePoint 2013 Federated Search Configuration
  • Enter the name for your result source:
    •  I've entered "Bing Search Results" 
    • Choose the Protocol as "OpenSearch 1.0/1.1
    • Source URL - This is important. Source URL specifies our source for Federation.
      • For Bing - Enter: http://www.bing.com/search?q={?searchterms}&format=rss&Market=en-US
      • For Twitter - http://search.twitter.com/search.atom?q={searchTerms}
    • Specify the credentials. I've specified "Anonymous". Click on "Save" button to create result source.
      sharepoint 2013 federated search results

Step 2: Create a query rule to include federated search results in SharePoint search results page
Query rules defines the outcome (Such as Promoted Result, Result block, etc) of search query.
  • From site settings page, Click on "Query Rules" link this time.
  • Choose Result source as "Local SharePoint Results" and click on "New Query Rule" link.
    configure federated search in sharepoint 2013
  • In "Add Query Rule" page, Give a name to your query rule. Click on "Remove Condition" link under Query conditions. In "Actions" section, click on "Add Result Block" link, You'll be prompted with the "Add Result Block" dialog box.
    sharepoint 2013 create federated search
  • In Add Result block page:
    • Enter the title for your result block. I've entered "Bing Search Results for "{subjectTerms}" 
    • In Query section, Choose the search source as "Bing Search Results" we created in step 1.
    • Choose Number of items to show in search results.
    • Under Settings, Choose "This block is always shown above core results"option. Click "Ok" to create a result block.
  • Click Save to save your query rule.
sharepoint 2013 federated search bing

That's all. We've done with SharePoint 2013 federated search configuration. Lets see the Federated search results in action:
sharepoint 2013 federated search results

Delete Unique Permissions (Reset Broken Inheritance) In SharePoint 2013 using PowerShell

$
0
0
Got a requirement to reset customized permissions of a large set of SharePoint libraries and documents.You can reset the permission inheritance and delete unique permissions for a site/web/folder/item level where the inheritance was previously broken. E.g. for a library:
  1. Go to your library, Click on Library settings.
  2. In the settings page, under users and permissions, click on "Permissions for this document library"
  3. Click on "Delete Unique permissions" button in ribbon from Inheritance group.
For site level, You have to do this from: Site settings >> Site Permissions Link. And for folder/list item/file level, You can do the same by: Click on "Shared with" button from the ribbon (you can get the same from items context menu) >> Click on Advanced >> and click on "Delete unique permissions".

The permission levels are set to Inherited from the parent and the permission level is updated to reflect the changes.Alright!

Needless to say, picking up each and every individual library and file to remove unique permissions is tedious, I wrote this PowerShell script to do the magic! Here is my PowerShell scripts to delete unique permissions at web, list, folder and list item levels.
Important: SharePoint 2013 permissions are inherited from Web level. So, If you break or reset inheritance at top level - All lists, libraries, folders and files will inherit permissions as in the parent web - customized permissions on list/folder/item level will go lost!

Reset Inheritance at site level using PowerShell:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Variables for Web URL, List Name
$WebURL ="https://intranet.crescent.com/marketing"

#get the list object
$web = Get-SPWeb $WebURL

# Check if web has Unique permission - Root webs always uses Unique permission
if ( ($web.HasUniqueRoleAssignments) -and ($web.IsRootWeb -eq $false ) )
{
#Reset broken inheritance
$web.ResetRoleInheritance()
Write-host "Broken Inheritance Reset on web:" $web.URL
}

SharePoint reset broken permissions on a list:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Variables for Web URL, List Name
$WebURL ="https://intranet.crescent.com/marketing/"
$ListName ="Invoices"

#get the list object
$List = (Get-SPweb $WebURL).lists.TryGetList($ListName)

# If List Exists with Unique permission
if ( ($list -ne $null) -and ($list.HasUniqueRoleAssignments) )
{
#Reset broken list inheritance
$list.ResetRoleInheritance()
Write-host "Broken Inheritance Reset on List:" $list.Title
}

<#To Reset Folder level inheritance, Use:
foreach ($folder in $list.Folders)
{
if ($folder.HasUniqueRoleAssignments)
{
Write-Host "Resetting Folder inheritance at:" $folder.Url
$folder.ResetRoleInheritance()
$folder.Update()
}
}
#>

Delete Unique permissions on all lists:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Variable for Web URL
$WebURL ="https://intranet.crescent.com/marketing/"

#get Web object
$Web = Get-SPWeb $WebURL

#Get Lists with Unique permissions - Exclude Hidden lists
$ListColl = $web.lists | Where-Object { ($_.HasUniqueRoleAssignments -eq $true) -and ($_.hidden -eq $false) }

#Enumerate through each list and reset permission inheritance
foreach($list in $ListColl) #if($list) #Exists
{
#Reset list inheritance
$list.ResetRoleInheritance()
Write-host "Broken Inheritance Reset on List:" $list.Title
}

Remove unique permissions on List Items:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Variables for Web URL, List Name
$WebURL ="https://intranet.crescent.com/marketing/"
$ListName ="Invoices"

#Get the list items with Unique permissions
$ListItems = (Get-SPweb $WebURL).lists.TryGetList($ListName).Items | Where {$_.HasUniqueRoleAssignments}

# If List Exists with Unique permission
Foreach($ListItem in $ListItems)
{
#Reset broken list item inheritance
$ListItem.ResetRoleInheritance()
Write-host "Broken Inheritance Reset on List Item:" $ListItem.URL
}
We can also delete unique permissions of all list items in a single line as:
(Get-SPweb "https://intranet.crescent.com/marketing/").Lists["Invoices"].Items | Foreach-Object{ $_.ResetRoleInheritance() }
Related Posts:

Rename SharePoint Service Application, Proxy using PowerShell

$
0
0
If you want to rename a SharePoint service application or Service application proxy, There is now UI available. But PowerShell can help!

PowerShell script to rename SharePoint 2013 Service application and Proxy:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#### rename sharepoint service application proxy###
#Get the Service Application proxy
$Proxy = Get-SPServiceApplicationProxy | ? {$_.Name -eq "Search SSA Proxy"}
#Rename Service application proxy
$Proxy.Name = "Search Service Application Proxy"
$Proxy.Update()

###sharepoint 2013 rename service application###
#Get Service application
$Service = Get-SPServiceApplication -Name "Search Service App"
#Rename Service application
$Service.Name = "Search Service Application"
$Service.Update()
After the rename:
rename search service application sharepoint 2010
rename SharePoint service application

SharePoint Error - Cannot complete this action. Please try again

$
0
0
Problem:
Users get "Error - Cannot complete this action. Please try again" error when trying to delete documents from Context menu (But file gets deleted!). While deleting documents from SharePoint 2013 ribbon button "delete document" works without any issues, choosing "Delete" from document's context menu gives this error.
Also, While trying to create a new View or Modify view: when you hit save button, you get:https://your-sharepoint-site.com/_vti_bin/owssvr.dll?CS=65001 - in the URL with blank page.

Troubleshooting:
Tried bypassing the load balancer by logging into individual WFEs and verified that the above errors are not happening in both the scenarios.

Temporary Fix: Disable "Minimal Download Strategy" feature from site settings >> Manage site features page. 
Permanent fix:
Compared response headers from SharePoint WFEs and from Load balancers using fiddler - Found load balancer response missing the response header "Accept-Encoding" field!

Update: You can find the more info on this issue here: https://finarne.wordpress.com/2014/12/10/sharepoint-2013-error-after-creating-a-view/

SharePoint 2013 Composed Looks Feature

$
0
0
Themes are the quick and easiest way to apply branding to SharePoint sites. Themes got changed over time in SharePoint's history. Now in SharePoint 2013, Themes are redesigned as "Composed Look" feature. As it sounds "Composed" look, it simply defines theming by combining design elements: Master page - AKA site layout, Color theme, Font schemes and background images.

No more thmx - PowerPoint themes which was introduced in SharePoint 2010, these themes can't be used in SharePoint 2013.

How to Apply composed look in SharePoint 2013? :
You can get the option to change SharePoint 2013 themes via "Change the Look" link from the Site Settings menu. Same is available under Look and Feel group of Site settings page.
 Change the look wizard and shows a thumbnail view of available designs. These designs are defined in a special list: "Composed Looks".
 

SharePoint 2013 Apply composed look:
To apply a composed look, Click on:
  • Site Settings >> Change the Look 
  • Select the new look to apply
  • Click on "Try it out" link >> SharePoint will give you the preview of your SharePoint site with the new theme 
  • Once you confirm by "Yes, Keep it", the new look and feel is applied to your SharePoint 2013 site.

Create composed look in SharePoint 2013:

In Short: To Create and Apply your custom theme in SharePoint 2013, There are three steps: 
Step 1: Create and upload theme elements: Master Pages, spcolor, spfonts, etc. to SharePoint.

Step 2: Register your Theme: Create a list item in "Composed Looks" list populating your theme artifacts. This will make your theme available in the design gallery at http://your-site-url/_layouts/15/designgallery.aspx

Step 3: Apply theme: You can apply theme from Site settings - Change the Look. You can also apply theme programmatically.
As illustrated above image, To create a custom composed look in SharePoint 2013, We need these artifacts ready. BTW, These design elements are reusable - Meaning can be used in any number of custom theme (or call it "Composed Look")!
  • Master Page - AKA - Site Layout
  • Color palette - AKA - Theme
  • Font scheme  - Optional
  • Background image  - Optional
Master Page URL - A reference to either a default or custom master page which is already uploaded to the master page gallery. This master page must accompanying a .preview file with the exact name - (with the .preview extension instead of .master). Otherwise, you won't get composed look preview.

Color Palette:
Color palette is nothing more than an normal XML file with a .spcolor extension. By default, color palette contains 89 Color slots of Key-Value pair.
E.g.
<s:color name="FooterBackground" value="7F333333" />
Where the first two digits: 7F represents the Transparency (optional) and rest for HEX value of the color.
  
SharePoint 2013 Color Palette Tool:
While editing the .spcolor file can be done with SharePoint Designer or notepad, Microsoft offers a nifty tool to make it simple. You can download color palette tool for SharePoint 2013 from Microsoft: http://www.microsoft.com/en-us/download/details.aspx?id=38182
This tool also lets you open a OOTB color palette and modify the colors. Once you built your customized color palette, You can upload it to the Theme Gallery (Site settings >> Themes >> 15 (Shortcut:  /_catalogs/theme/15/ ) and use it in a composed look. This gallery generally resides on the root web level and has theme files, Color palette and font schema inside 15 folder.

Font scheme:  (Optional)
SPFont File - This file contains all the font definitions for the Composed Look. The font scheme is also an XML file with a .spfont extension. There are 7 font slots with names such as title, navigation, and small-
heading. Font schemes can be easily edited with any Text editor or SharePoint designer.(Download any existing font scheme and do your changes)

Upload your .spfont file under: Site Settings > Themes > 15 > add new document then use that link to
the .spfont file in your Composed Look item.
Please note: The .spfont and .spcolor files must be in the /_catalogs/theme/15 folder, NOT in a sub-folder!
Color Pallette and Font Scheme reference: http://msdn.microsoft.com/en-us/library/office/jj945889.aspx

Background Image (Optional) - The image that will cover the entire background of your SharePoint pages.

Once you have all these artifacts ready, The next step is: Making an entry in Composed Looks list to pack it as a theme!

The "Composed Looks" List:

As the name suggests, This library contains all composed looks. This list actually contains master page URL, image URL, theme(color palette) URL, Font Scheme URL and Display Order. So, all of them together is a theme.

You can launch this list by: Site settings >> under "Web Designer Galleries" Group >> Composed looks:
Once you have the above artifacts ready and uploaded to respective folders, To make your own Composed Look, go to:
  • Site Settings > Composed looks under the Web Designer Galleries heading 
  • Click on add new item.  
  • From there you simply fill out the form giving the title, name and URLs to your custom Master Page (which may have custom CSS files linked inside) and other artifacts.
Once you have the entry for your theme in this list you can see your composed look/theme available on "Change Look" page.

SharePoint 2013 Sign in as Different User Missing - Feature Based Solution

$
0
0
Sign in as different user menu option is missing in SharePoint server 2013, it has many possible workaround which are explained in my earlier post:  Sign in as Different User in SharePoint 2013 - Workarounds

How to add sign in as different user in SharePoint 2013:
To enable sign in as different user in SharePoint 2013, Lets build a feature based solution using Visual Studio:
  • Open Visual Studio 2013 (or 2012) >> Click on File >> New >> Project
  • Choose: Office/SharePoint >> SharePoint 2013 - Empty Project. Name your solution and click on "OK"
    sharepoint foundation 2013 sign in as different user
  • Enter the site for debugging and choose "Farm Solution" (Doesn't matters even its a sandboxed solution too!) and click on "Finish" button. wait for Visual studio to create project structure.
    how to add sign in as different user in sharepoint 2013
  • Now, in Visual studio, Right click the "Project" node from solution explorer window, choose Add >> New Item menu.
  • Choose "Module"and give it a name. Click on Add.
    sign in as different user menu option is missing in sharepoint server 2013
  • This module brings a feature "feature1" and "Sample.txt" File by default. Remove the sample.txt from the solution and rename Feature1 to something meaningful, I've made it as same as my project name - SignInAsDiffUser
    sign in with different user sharepoint 2013
  • Update the elements.xml file with the below code
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="LoginAsDifferentUser"
    GroupId="PersonalActions"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="1000"
    Title="Sign in as Different User">
    <UrlAction Url="/_layouts/closeConnection.aspx?loginasanotheruser=true"/>
    </CustomAction>
    </Elements>
  • Now, Right click the Feature, "SignInAsDiffUser" from solution explorer and choose "View Designer"menu item.
  • In the feature designer page, Give a name and description to your feature. Set the scope for the feature, I've made it : Site, So that it will be applicable for the entire site collection. Make sure the module we've created is included in the feature.
    add sign in as different user in sharepoint 2013
  • Right click the solution in visual studio, choose Deploy. This will automatically Build,deploy and active your feature. Go to site collection features and make sure "Sign in As different User"feature is activated.
    how to enable sign in as different user in sharepoint 2013
Now, You'll be getting "Sign in As Different" user menu item under your personal settings menu in SharePoint foundation /Server.
enable sign in as different user sharepoint 2013

SharePoint User Permission Analysis & Reporting using PowerShell

$
0
0
Analysing SharePoint permissions for a particular user is often a common task in SharePoint administration. Generally, How do we check what permissions a user has on SharePoint content? By getting into site or list settings page and check permissions for the particular user, isn't it? Well, You may want to analyze the particular user's permissions for your entire SharePoint environment.  How about that? Each and every SharePoint site, list, library, folder and list items may have unique permissions. It can even go more challenging when you have multiple SharePoint farms.

Well, PowerShell is the life saver! Here is my permission reporting solution to scan and provide a report to view a user's permission on the SharePoint web application. With this script, you can analyze and track the security effectively! Check what permissions on an account has been granted in all places in SharePoint. This PowerShell script scans below areas to retrieve a specific user's access rights:
  • Farm administrator's group
  • Central administration web application policies
  • Site collection administrators 
  • Scans all site collections and sub-sites with unique permissions in which user has access.
  • Scans all lists and libraries with unique permissions in which user has access.
  • Scans all folders and list Items which has permissions in the site in which user has access.
Just change the Input variables section and provide parameters for User Id, Web Application and Report path variables and run the script in PowerShell.

After generating a SharePoint permissions report, this script generates a CSV file, which can be export as excel file to allows the further research and analyze outside of a SharePoint environment. It gets data such as:  Object, Title, URL, Permission Type, Permissions as in the below screenshot.
PowerShell Script to Generate User Permission Report in SharePoint 2010/2013

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Function to retrieve Permission data
Function Get-PermissionInfo([String]$UserID, [Microsoft.SharePoint.SPSecurableObject]$Object)
{
#Object Array to hold Permission data
$PermissionDataCollection = @()

#Determine the given Object type and Get URL of it
switch($Object.GetType().FullName)
{
"Microsoft.SharePoint.SPWeb" { $ObjectType = "Site" ; $ObjectURL = $Object.URL }
"Microsoft.SharePoint.SPListItem"
{
if($Object.Folder -ne $null)
{
$ObjectType = "Folder" ; $ObjectURL = "$($Object.Web.Url)/$($Object.Url)"
}
else
{
$ObjectType = "List Item"; $ObjectURL = "$($Object.Web.Url)/$($Object.Url)"
}
}
#Microsoft.SharePoint.SPList, Microsoft.SharePoint.SPDocumentLibrary, "Microsoft.SharePoint.SPPictureLibrary",etc
default { $ObjectType = "List/Library"; $ObjectURL = "$($Object.ParentWeb.Url)/$($Object.RootFolder.URL)" }
}

#Get Permissions of the user on given object - Such as: Web, List, Folder, ListItem
$UserPermissionInfo = $Object.GetUserEffectivePermissionInfo($UserID)
#Iterate through each permission and get the details
foreach($UserRoleAssignment in $UserPermissionInfo.RoleAssignments)
{
#Get all permission levels assigned to User account directly or via SharePOint Group
$UserPermissions=@()
foreach ($UserRoleDefinition in $UserRoleAssignment.RoleDefinitionBindings)
{
#Exclude "Limited Accesses"
if($UserRoleDefinition.Name -ne "Limited Access")
{
$UserPermissions += $UserRoleDefinition.Name
}
}

#Determine Permissions granted directly or through SharePoint Group
if($UserPermissions)
{
if($UserRoleAssignment.Member -is [Microsoft.SharePoint.SPGroup])
{
$PermissionType = "Member of SharePoint Group: " + $UserRoleAssignment.Member.Name
}
else
{
$PermissionType = "Direct Permission"
}
$UserPermissions = $UserPermissions -join ";"

#Create an object to hold storage data
$PermissionData = New-Object PSObject
$PermissionData | Add-Member -type NoteProperty -name "Object" -value $ObjectType
$PermissionData | Add-Member -type NoteProperty -name "Title" -value $Object.Title
$PermissionData | Add-Member -type NoteProperty -name "URL" -value $ObjectURL
$PermissionData | Add-Member -type NoteProperty -name "Permission Type" -value $PermissionType
$PermissionData | Add-Member -type NoteProperty -name "Permissions" -value $UserPermissions
$PermissionDataCollection += $PermissionData
}
}
Return $PermissionDataCollection
}

#Function to Generate Permission Report
Function Generate-PermissionReport($UserID, $WebAppURL, $ReportPath)
{
#Output Report location, delete the file, If already exist!
if (Test-Path $ReportPath)
{
Remove-Item $ReportPath
}

#Write Output Report CSV File Headers
"Object, Title, URL, Permission Type, Permissions" | out-file $ReportPath

###Check Whether the Search Users is a Farm Administrator ###
Write-host "Scanning Farm Administrators..."
#Get the SharePoint Central Administration site
$AdminWebApp = Get-SPwebapplication -includecentraladministration | where {$_.IsAdministrationWebApplication}
$AdminSite = Get-SPWeb $AdminWebApp.Url
$AdminGroupName = $AdminSite.AssociatedOwnerGroup
$FarmAdminGroup = $AdminSite.SiteGroups[$AdminGroupName]

#enumerate in farm adminidtrators groups
foreach ($user in $FarmAdminGroup.users)
{
if($user.LoginName.Endswith($UserID,1)) #1 to Ignore Case
{
"Farm, $($AdminSite.Title), $($AdminWebApp.URL), Farm Administrators Group, Farm Administrator" | Out-File $ReportPath -Append
}
}

### Check Web Application User Policies ###
Write-host "Scanning Web Application Policies..."
$WebApp = Get-SPWebApplication $WebAppURL

foreach ($Policy in $WebApp.Policies)
{
#Check if the search users is member of the group
if($Policy.UserName.EndsWith($UserID,1))
{
#Write-Host $Policy.UserName
$PolicyRoles=@()
foreach($Role in $Policy.PolicyRoleBindings)
{
$PolicyRoles+= $Role.Name +";"
}
#Send Data to CSV File
"Web Application, $($WebApp.Name), $($WebApp.URL), Web Application Policy, $($PolicyRoles)" | Out-File $ReportPath -Append
}
}

#Convert UserID Into Claims format - If WebApp is claims based! Domain\User to i:0#.w|Domain\User
if($WebApp.UseClaimsAuthentication)
{
$ClaimsUserID = (New-SPClaimsPrincipal -identity $UserID -identitytype 1).ToEncodedString()
}

#Get all Site collections of given web app
$SiteCollections = Get-SPSite -WebApplication $WebAppURL -Limit All

#Loop through all site collections
foreach($Site in $SiteCollections)
{
Write-host "Scanning Site Collection:" $site.Url
###Check Whether the User is a Site Collection Administrator
foreach($SiteCollAdmin in $Site.RootWeb.SiteAdministrators)
{
if($SiteCollAdmin.LoginName.EndsWith($ClaimsUserID,1))
{
"Site Collection, $($Site.RootWeb.Title), $($Site.RootWeb.Url), Site Collection Administrators Group, Site Collection Administrator" | Out-File $ReportPath -Append
}
}

#Get all webs
$WebsCollection = $Site.AllWebs
#Loop throuh each Site (web)
foreach($Web in $WebsCollection)
{
if($Web.HasUniqueRoleAssignments -eq $True)
{
Write-host "Scanning Site:" $Web.Url

#Get Permissions of the user on Web
$WebPermissions = Get-PermissionInfo $ClaimsUserID $Web

#Export Web permission data to CSV file - Append
$WebPermissions | Export-csv $ReportPath -notypeinformation -Append
}

#Check Lists with Unique Permissions
Write-host "Scanning Lists on $($web.url)..."
foreach($List in $web.Lists)
{
if($List.HasUniqueRoleAssignments -eq $True -and ($List.Hidden -eq $false))
{
#Get Permissions of the user on list
$ListPermissions = Get-PermissionInfo $ClaimsUserID $List

#Export Web permission data to CSV file - Append
$ListPermissions | Export-csv $ReportPath -notypeinformation -Append
}

#Check Folders with Unique Permissions
$UniqueFolders = $List.Folders | where { $_.HasUniqueRoleAssignments -eq $True }
#Get Folder permissions
foreach($folder in $UniqueFolders)
{
$FolderPermissions = Get-PermissionInfo $ClaimsUserID $folder

#Export Folder permission data to CSV file - Append
$FolderPermissions | Export-csv $ReportPath -notypeinformation -Append
}

#Check List Items with Unique Permissions
$UniqueItems = $List.Items | where { $_.HasUniqueRoleAssignments -eq $True }
#Get Item level permissions
foreach($item in $UniqueItems)
{
$ItemPermissions = Get-PermissionInfo $ClaimsUserID $Item

#Export List Items permission data to CSV file - Append
$ItemPermissions | Export-csv $ReportPath -notypeinformation -Append
}
}
}
}
Write-Host Permission Report Generated successfully!
}

#Input Variables
$WebAppURL = "http://intranet.crescent.com"
$Userid ="Crescent\Salaudeen"
$ReportPath = "D:\Reports\PermissionRpt.csv"

#Call the function to generate user access report
Generate-PermissionReport $Userid $WebAppURL $ReportPath
You can also download the script from Technet gallery: SharePoint Permission Report: Check Access Rights for a Specific User

This script is broken into two functions. So that you can use the first function: Get-PermissionInfo to get permissions data scoped to a site collection permission report/site. Above script scoped at a particular web application. You can call the same function on all your web application to get the entire SharePoint permissions reports.

PowerShell Scripts to generate SharePoint Permission Reports:
Here is my list of PowerShell scripts to create various reports for SharePoint permission auditing.

3rd Party Tools:
There are many tools in the market to analyze, audit SharePoint user permissions (and more features naturally!). Here are some:

Fix Quick Edit Disabled in SharePoint 2013 Issue

$
0
0
Datasheet view is now called "Quick Edit" in SharePoint 2013. It provides a nice flexible Excel like editor to bulk edit, copy-paste list items and metadata. Similar to a spreadsheet you can create, change and delete items in the grid. As with the new name, quick edit brought many new features in SharePoint 2013, such as:
  1. You can Edit Managed Metadata columns (Still Rich text columns are not editable in Quick Edit! content type change can't be done from quick edit!!)
  2. It works just fine in other browsers ( I tested with Firefox and Chrome), where SharePoint 2010 Datasheet view was working ONLY with internet explorer 32 bit version.
  3.  No more Active-X control dependencies. Quick edit doesn't need Office access run time engine now!
  4. It supports Filters now! Remember the pain of losing filters on datasheet views in those old days?
You can launch quick edit mode either from "Quick Edit" button in List Tab, or clicking "Edit" link as in the below screen.
quick edit not working in sharepoint 2013
Quick edit is not working in SharePoint 2013?
In my SharePoint environment, few users having trouble with quick edit. Found Quick Edit button on the "List" tab is disabled (grayed out) with an error message "This control is currently disabled" and "Edit" link missing! How to enable quick edit in SharePoint 2013?
sharepoint 2013 quick edit not working
Here is my check list to troubleshoot quick edit not working issue:
  1. Check Quick Edit is Enabled: To enable/disable quick edit in SharePoint 2013, you need to navigate to: List Settings >> Advanced settings page >> Scroll down and Under quick edit option,  choose "Yes" and then click OK.sharepoint 2013 list quick edit disabled
  2. Remove the Group By: If you have grouping enabled in your Views, You got to remove it! If you group list or library items in SharePoint 2013, quick edit (Datasheet View) option is disabled. remove "Group By" selection by setting it to none.
  3. Change the View style to default: Changing view style to "Shaded", "Newsletter" or something else disables Quick Edit. Change it to "default" in view settings. https://support.microsoft.com/kb/2876824
  4. Enable 'Allow individual item" check boxes: In view settings make sure, "Allow Individual Items Check boxes" is enabled.    sharepoint 2013 quick edit this control is currently disabled
  5. If you are in datasheet view already- If your current view is "Datasheet view" then quick edit is disabled (obviously!). 
  6. SharePoint View definition XML uses an attribute "<JSLink>clienttemplates.js</JSLink>". During a migration, I had to add this to an existing view using SharePoint designer and verified Quick Edit works as expected.
  7. Last but not least: Try creating a new view using "Standard View".
Quick edit is not performing well with large lists. You may get "Unable to communicate with server" error and slowness when dealing with large lists. Apply filters to mitigate that issue.

Tags: quick edit not working in sharepoint 2013; sharepoint 2013 quick edit not working; sharepoint 2013 list quick edit disabled; quick edit sharepoint 2013 not working; quick edit sharepoint 2013 disabled; sharepoint 2013 quick edit not available; sharepoint 2013 quick edit this control is currently disabled; sharepoint 2013 quick edit currently disabled; sharepoint 2013 quick edit not enabled; quick edit sharepoint 2013 greyed out; sharepoint 2013 quick edit grayed out; sharepoint 2013 quick edit issues

SharePoint 2013 Patch (Service Pack-CU-Hotfix) Installation Guide - Step by Step

$
0
0
So you want to maintain your SharePoint environment healthy, secure, stable and up to date by installing latest patches? Well, this article walks through the various steps involved in installing patches for your SharePoint 2013 environment.

SharePoint 2013 patching best practices
Before proceeding , Lets consider some of the best practices for SharePoint 2013 patching. I would strongly recommend patching your development/test SharePoint farms first before proceeding with the production environment. Make sure Dev/Test environments are thoroughly tested, all custom/third-party components are fully functional. Watch those environments, Identify and address common issues and then schedule the maintenance window for your SharePoint 2013 production farm.

Always, Its a good idea to stay one CU behind the current release (or 3 to 6 Moths behind latest patch) for production environments to avoid any potential issues that may be introduced by a new CU. Simply installing the latest updates is not a best practice and may put your environment at risk. Take snapshot backups of your SharePoint servers before applying updates. (That's why I'm a big fan of SharePoint server visualization!). This will help when things don’t go right.

Downtime Mitigation: If you have a TEST environment closer to production, you can backup-restore SharePoint content databases, make them read-only, Change the publishing servers to point TEST form as Production farm during this maintenance window. Keep your user community aware of this maintenance window. Plan and send out a proper e-mail communication about the scheduled maintenance. SharePoint 2013 provides an excellent way SharePoint 2013 Maintenance Window Notifications

It is no longer required to install the SharePoint Foundation patches before proceeding with SharePoint Server patches.

SharePoint 2013 patch procedure
At high level, SharePoint 2013 patching process is done as follows:
  1. Get your current farm patch level
  2. Download SharePoint 2013 service pack/CU/Hot-fix
  3. Install binaries on SharePoint Servers
  4. Run the SharePoint Products Configuration Wizard
  5. Verify the updated build number of your SharePoint farm.

Step 1: Get SharePoint 2013 Patch Level

There are many ways to find SharePoint build numbers including PowerShell (more info:  How to find SharePoint Farm Build Version Number/Patch Level ). Here is the easiest way to find SharePoint patch level:
  • Go to your SharePoint 20103 Central Administration site. 
  • From the Central Administration, navigate to System Settings >> Manage Servers in this Farm
  • From the Servers in this Farm page, under the Farm information section, you will see the SharePoint Farm Build Version.
sharepoint 2013 check sharepoint patch level
To match the build number with SharePoint 2013 patch, use Todd Klindt's blog: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=346

Step 2: SharePoint 2013 patch download
To start with SharePoint 2013 patching, We must download the relevant patches first!. The major difference in downloading patches for SharePoint 2013 and its previous versions is: You don't have to download and install patches for both SharePoint Foundation and SharePoint Server, if you are running with SharePoint 2013 server. You can just download and install SharePoint Server patch alone!!

To download SharePoint 2013 service packs, hot-fixes and cumulative updates(CU), head on to Microsoft SharePoint updates site: http://technet.microsoft.com/library/dn789211(v=office.14)
You have to download the relevant patch depending on your SharePoint environment version/edition and patch level.
Download all patches to a network location so that you do not have to download for every server in the farm!

Step 3: Install SharePoint patch Binaries
The next step is to install service pack/patches to all SharePoint servers (except the database server). You can start with SharePoint App Server(s) that host Central Administration first.
  • Browse to the location where you downloaded patches. 
  • Start the patching process by double clicking the installers (you may have to extract the downloaded binaries!). Accept the license agreement and click on "Continue".
sharepoint 2013 service pack installation
  •  You should see the installation progress window. You may asked to reboot the server to complete patch installation.
  •  Wait for the installation is complete message.

Install Patches on All other servers in the Farm:
You must install any patch on every server in your SharePoint farm including WFE and App servers. SharePoint 2013 Products Configuration Wizard is good enough to detect and prevent you from proceeding, If you try to run SharePoint 2013 Products Configuration Wizard without installing binaries on all servers.
sharepoint 2013 patch management
Install all other required binaries before proceeding with the next step.

Step 4: Run SharePoint 2013 Products Configuration Wizard
Once binaries are installed on all SharePoint servers, The next step is run SharePoint 2010 Products Configuration Wizard.
  • Go to start >> Search "SharePoint products configuration wizard" and run PSConfig wizard as administrator. Click on Next to continue.
sharepoint 2013 foundation patch
  • You will get a warning message saying few services will be restarted during this upgrade process. Click Yes and then Click Next
  •  SharePoint products configuration wizard will run through the upgrade process. Wait for the wizard to complete.
  •  When the wizard is completed, click Finish.
sharepoint 2013 patching best practices
Repeat this patch procedures in rest your SharePoint Servers in the farm.

RunSharePoint 2013 Products Configuration Wizard ONE Server at a time:
We have to run SharePoint 2013 products configuration wizard in all other servers. Although SharePoint patch installation can happen simultaneously, I would suggest you run SharePoint Products Configuration Wizard only on ONE sever at a time! Start from App Server which hosts central admin, Once its completed move on to other app servers and then SharePoint web front ends. SharePoint 2013 patching process may take about 30 minutes on each server.

If you try to run the wizard simultaneously, You'll get to see SharePoint 2013 places a lock until the configuration gets completed on the other server already running the wizard.

Step 5: Verify Installation for SharePoint 2013 Service Pack:
We have successfully installed patches in our SharePoint 2013 environment. To verify patching and make sure installation is successful lets check the farm's build number. There are many ways to find SharePoint build number (more info:  How to find SharePoint Farm Build Version Number/Patch Level ). Here is the easiest one:
  • Go to your SharePoint 20103 Central Administration site. 
  • From the Central Administration, navigate to System Settings >> Manage Servers in this Farm
  • From the Servers in this Farm page, under the Farm information section, you will see the Configuration Database Version.
sharepoint 2013 service pack version number
Make sure your new build number is matching with the patch your have just installed. Also, check "Manage Servers in this Farm" page in Central administration. This page will also tell you if you need to run the SharePoint Products Configuration Wizard on a server to complete the update process. Make sure every server in your SharePoint farm is upgraded and displays status as "No Action Required".
SharePoint 2013 patch status page:
You can check the patch status on each and every individual server with "Manage patch status page" (Central Administration >> Upgrade and Migration >> Check product and patch installation status.
sharepoint 2013 patch status page
"Check upgrade status" page gives insights on detailed upgrade status information.
sharepoint 2013 patch status page
Don't just stop by SharePoint 2013 service pack installation. But apply Windows Server OS patches and SQL Server patches on regular maintenance windows.

SharePoint 2013 Service installation failed?
In case of failure, review the error log presented to determine the source . Simply re-running the products configuration wizard worked for me any times! or you may have to run psconfig command instead of running the wizard.
psconfig -cmd upgrade -inplace b2b -wait
 
What is the difference between service pack, Cumulative updates and hot fixes (or patches)?
  • Hotfix/patch is a update addressing a specific problem/bug/security issue. On Demand - normally not for everyone, you should only apply the patch if you're having the specific problem it addresses. Microsoft publishes a corresponding KB article for every hotfix that is released for every Microsoft product. 
  • Cumulative Updates  - As their name suggest, they are cumulative in content so they include a collection previously released hotfixes to date. Hotfixes and CUs are not always publicly released.  You'll get a link to download these hotfixes and CUs on requesting via Microsoft site. 
  • Service pack is a collection of CUs (and patches). It rolls together all patches that have come along over a given period of time. - Usually contains new features and available to public.
Every Hotfix, CU, Service pack you install, will increment the version/build number of your SharePoint Farm.

Design Manager Missing in SharePoint 2013?

$
0
0
Problem:
Design Manager is a new feature introduced in SharePoint Server 2013 publishing sites to manage branding. You are not seeing "Design Manager" in SharePoint 2013?
sharepoint design manager missing
Solution:
Well, to enable design manager in SharePoint 2013, You got to activate "Publishing" Feature!
  • Go to "Site Settings" of your root site collection >> Click on "Site collection features" under site collection administration
  • Click on "Activate" button next to "SharePoint Server Publishing Infrastructure".
    sharepoint 2013 design manager not visible
  • Activate "SharePoint Server Publishing Infrastructure" from site features via "Site Setting" >> Click on "Manage site features" and activate SharePoint Server Publishing Infrastructure.
 Now, You'll get design manager link in Site actions menu and in site settings page!
design manager sharepoint 2013 missing


Branding SharePoint 2013 Top Navigation Menu bar with Custom CSS

$
0
0
Branding SharePoint top navigation is one of the frequent requirement in SharePoint implementations. Here is my quick way to apply branding to SharePoint 2013 top navigation menu. 

Step 1: Create a custom CSS file with custom styles for your navigation menu (Find my CSS below!). Upload it either to site assets library/Master pages folder or to file system (/_Layouts/Styles/).

Step 2: Edit the HTML master page and add reference to your custom CSS.
Open the HTML master page of your site in SharePoint designer (by default: Seattle.html), Locate this chunk:
<!--SPM:<SharePoint:CssRegistration Name="Themable/corev15.css" runat="server"/>-->
Add this line just below it:
<!--SPM:<SharePoint:CssRegistration Name="http://YOUR-SITE-COLLECTION-URL/SiteAssets/YOUR-CSS-FILE.css" runat="server" After="corev15.css" />-->
Rather hard-coding the URL, upload/deploy custom CSS to Master Pages folder and set the path as:
<!--SPM:<SharePoint:CssRegistration name="&lt;% $SPUrl:~site/_catalogs/masterpage/YOURFOLDER/YOUR-style-Sheet.css %&gt;" runat="server" after="SharepointCssFile" />-->

Custom CSS to Branding SharePoint 2013 Top Navigation Menu:
and my Custom CSS goes here:
 /*** Top Navigaion Menu Items container DIV ***/
.ms-core-listMenu-horizontalBox {
background-color: #47A4D3;
}

/*** Top Navigaion Static Menu Items ***/
.ms-core-listMenu-horizontalBox li.static {
border: 1px solid transparent;
background: url("/_layouts/Images/selbg.png") repeat-x left top;
}

/*** Top Navigaion Static Menu Item Links ***/
.ms-core-listMenu-horizontalBox li.static > .ms-core-listMenu-item {
color: #21374C;
white-space: nowrap;
border: 1px solid transparent;
padding: 10px;
padding-left: 20px;
margin-right: 1px;
}

/* Top Navigation static Menu Item Links Hover Style */
.ms-core-listMenu-horizontalBox li.static > .ms-core-listMenu-item:hover {
background: url("/_layouts/Images/selbg.png") repeat-x left top;
background-color: #0A85C4;
color: #fff;
text-decoration: none;
}

/*** Top Navigaion Static Menu Selected ***/
.ms-core-listMenu-horizontalBox li.selected a.selected {
/* Glass Effect Shade Image */
background: url("/_layouts/Images/selbg.png") repeat-x left top;
/* Glass Effect Shade Image */
background-color: #0A85C4;
color: #fff;
text-decoration: none;
border: 1px #134072 solid;
padding: 10px 10px;
margin: 1px;
}

/*** Sub-Menu/Flyover/Dynamic Menu Container ***/
ul.dynamic {
background-color: #D5E4F2;
border: 1px solid #000;
padding: 1px;
margin-top: 5px;
}

/*** Sub-Menu Items (HyperLinks) Style ***/
ul.dynamic .ms-core-listMenu-item {
background-color: #f7f7f7;
padding: 10px 20px 10px 20px;
white-space: nowrap;
}


/*** Sub-Menu Items (HyperLinks) Hover Style ***/
ul.dynamic .ms-core-listMenu-item:hover {
background-color: #61CBFD;
color: #FFF;
}

/** Hide "Edit Links" ***/
.ms-listMenu-editLink {
display: none !important;
}

Rackspace has good CSS reference: http://sharepoint.rackspace.com/branding-top-navigation-in-sharepoint-2013, 

Here is my branded SharePoint 2013 top navigation menu bar.
 Here is my another post on: Branding SharePoint 2010 Top Navigation
Viewing all 1058 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>