Monday, September 29, 2014

How to Add Enterprise Keywords Column To SharePoint List or Library

Enterprise keywords column in SharePoint (or folksonomy) enables end users to add tags to documents and Items. Here is how to enable enterprise keywords column to SharePoint list and libraries.

How to add enterprise keywords column in SharePoint?
To enable enterprise keywords field in SharePoint, Go to: List/Library Settings >> Enterprise Metadata and Keywords Settings >> Enable Enterprise Keywords at "Add Enterprise Keywords" section by selecting "Add an Enterprise Keywords column to this list and enable Keyword synchronization"
Add Enterprise Keywords Column To SharePoint List or Library
This should bring new column "Enterprise Keywords "to your SharePoint list.
sharepoint 2013 enterprise keywords column
These column values are stored in MMS service application term store and can be refined later.

Enable enterprise keywords & Add enterprise keywords column programmatically using PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for Web URL and List Name
$WebURL ="https://intranet.crescent.com"
$ListName="Purchase Documents" 

#Get web and List objects
$Web = Get-SPWeb $WebURL
$list = $web.Lists.TryGetList($ListName);

if ($list -ne $null)
{  
  #Check if the list has enterprise column already
  if ($list.Fields.ContainsField("Enterprise Keywords") -eq $false)
  {
    #Add Enterprise keywords column to list
    $list.Fields.Add($list.ParentWeb.AvailableFields["Enterprise Keywords"])
    $list.Update()

    write-host "Enterprise Keywords column added successfully to the list!"
  }
} 
This enables enterprise column automatically and adds it to the list.

Rename-Remove enterprise keywords column:
As  with any other column, Enterprise keywords column also can be renamed or removed from list settings. Just pick the column from List settings "Columns"section and you'll get the options to rename enterprise keywords column in SharePoint.
sharepoint 2010 remove enterprise keywords column


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


Change Distributed Cache Service Account in SharePoint 2013 with PowerShell

Distributed Cache service caches data for fast retrieval across several features in SharePoint Server 2013, such as : News feeds, Authentication, Security Trimming, OneNote client access, Page load performance, etc.

When SharePoint 2013 is installed, AppFabric service is installed as part of the SharePoint pre-requisites, and configured to run under the credentials of Farm account, Which is not ideal and triggers an alert in SharePoint 2013 Health Analyzer.

"The server farm account should not be used for other services."
Domain\Account the account used for the SharePoint timer service and the central administration site, is highly privileged and should not be used for any other services on any machines in the server farm. The following services were found to use this account: Distributed Cache Service(Windows Service).
"The server farm account should not be used for other services."
It also gives the remedy to change service account.  So as per the advice, if you try to navigate to the page (or via Central Admin >> Security >> General Security >> Configure Service Accounts) and try to change service account for "Distributed Cache Service", you will experience an error:

Sorry, something went wrong
Distributed Cache Service does not support this operation from Central Administration. Please use Sharepoint Powershell commandlets.
Change Distributed Cache Service Account in SharePoint 2013 with PowerShell

Set SharePoint 2013 distributed cache service account
So, You cannot change SharePoint Server 2013 Distributed Cache service account using Central Admin site. We got to use PowerShell to change Distributed Cache Service Account in SharePoint 2013. Login to a farm server using your administrator account, register a managed account and run these PowerShell cmdlets.

PowerShell script to Change Distributed Cache Service Account in SharePoint 2013:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get the Farm
$Farm=Get-SPFarm

#Get Distributed Cache Service
$CacheService = $Farm.Services | where {$_.Name -eq "AppFabricCachingService"}

#Get the Managed account 
$ManagedAccount = Get-SPManagedAccount -Identity "Crescent\SPS_Services"

#Set Service Account for Distributed Cache Service
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser" 
$cacheService.ProcessIdentity.ManagedAccount = $ManagedAccount
$cacheService.ProcessIdentity.Update()
$cacheService.ProcessIdentity.Deploy()

Write-host "Service Account successfully changed for Distributed Service!" 

Verify the change:
Once completed with the script execution, verify the change by navigating to:  Central Administration > Security > Configure Service accounts > Select Windows Service - Distributed Cache. Make sure the new service account is displayed.
sharepoint 2013 change service account for distributed cache
If the change is not reflected, you may have to stop,remove and re-add distributed cache instance:
Stop-SPDistributedCacheServiceInstance
Remove-SPDistributedCacheServiceInstance
Add-SPDistributedCacheServiceInstance
Microsoft's Technet Article on changing distributed cache service account: http://technet.microsoft.com/en-us/library/jj219613.aspx#changesvcacct

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


Rename SharePoint Service Application, Proxy using PowerShell

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


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


Thursday, September 25, 2014

Create New Result Source for Federated Search using PowerShell

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

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


Tuesday, September 23, 2014

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

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.
The above methods works on SharePoint 2016 as well!

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


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


Monday, September 22, 2014

Using SharePoint Designer to Edit Property Bags

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!

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


Sunday, September 21, 2014

Edit Links Missing in SharePoint 2013 Navigation?

Edit Links is a new feature introduced in SharePoint 2013 to provide quick way to Add, Edit, Remove and Re-arrange links in quick launch and top navigation.  edit links not visible sharepoint 2013

Edit Links Missing in SharePoint 2013 Navigation? 
So, You are not getting Edit links in SharePoint 2013 navigation? Well, Check below factors:
  • Edit links available only on certain site templates such as: Team Site,  Publishing sites, Personal Site and Project site.
  • SharePoint 2013 edit links permission: You need to have "Edit "permission level at-least. For Contributors and Visitors SharePoint 2013 edit links is not available.
  • If your sub-site is inheriting navigation from Parent site, the link "Edit Links" in top navigation will not appear. To enable edit links SharePoint 2013 - Your site shouldn't inherit navigation from the parent site.edit links sharepoint 2013 missing
  • Its available only for "Structural Navigation" option under "Navigation Settings" on publishing sites.
  • You may have custom CSS deployed which hides "Edit Links"!
remove edit links from sharepoint 2013

How to remove edit links in SharePoint 2013?
Use this CSS in either at Master page or in Script/Content editor web parts to hide edit links in SharePoint 2013.
<style>
 .ms-navedit-editLinksText{
  display: none;
 }
 </style> 
This disables edit links in SharePoint 2013.

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


Saturday, September 20, 2014

Configuring Managed Accounts in SharePoint 2013

What is Managed Account in SharePoint? Why We Need Managed Accounts?
SharePoint uses service accounts for operations such as Farm account, application pools and for service applications. You have to keep a track of all service accounts with their password in a secured file in your system. If the password for any one of those accounts has been changed, the service which uses that specific service account will stop functioning, until you manually update them in SharePoint.

So, The solution comes with SharePoint 2010 and 2013 is you can register your service accounts as a Managed accounts, and you don't have to keep-up the passwords once you register them in your farm and you can manage those managed accounts centrally from SharePoint central administration.

SharePoint centrally stores managed accounts and passwords and it can change the password regularly-automatically, if needed. If there is a password expiry policy set on Active Directory, Then SharePoint automatically detects and changes the password before the scheduled date. (If automatic password change is enabled!). SharePoint also provides Email notification options prior changing the passwords.
In short, Managed accounts are active directory accounts whose credentials are managed by SharePoint
Not all accounts needs to be a managed accounts. E.g. In Search Service Application: Default content access account, which is used to crawl content is usually an un-managed account. Because, when SharePoint changes the password automatically, the content source its crawling may not get that, if its not a SharePoint content source.

How to Create a New Managed Account in SharePoint 2010/2013:

Before creating a managed account, They must be already created in your Active directory and you should create Managed accounts before provisioning web applications and service accounts, as you'll be prompted to choose managed account while creating a web application or service application. To create a new managed account with Central Administration, follow these steps:
  1. Go to Central Administration, Click Security >> Click on Configure Managed Accounts.
  2. Click the Register Managed Account link to create a new managed account.
  3. Enter the Service account's AD user name in domain\username format. Specify the account's password.
  4. If you want SharePoint to automatically change this account’s password on a regular schedule, check the "Enable Automatic Password Change" check box and specify when to change password in accordance to the password expiry policy of your AD.
  5. Check the "Start Notifying By E-mail" check box and specify the number of days before the password change you want to be notified.
  6. Specify the schedule for your password change. You can change the password weekly or monthly.
    You should set changes to occur during scheduled downtime or during light usage, because the password changes will cause momentary service interruptions as application pools are restarted.
  7. Click OK to save the new managed account.
SharePoint sends password change notifications to a single email address, which can be configured via Under: Security >> Configure Password Change Settings >> Notification E-Mail Address.

Add managed account in SharePoint 2013 using PowerShell:
To create a managed account using PowerShell, use the New-SPManagedAccount cmdlet. Here is how to add new managed accounts in SharePoint 2013 using PowerShell:

Configuring Managed Accounts in SharePoint 2013
If you have created a new managed account or want to change the mapping of managed Accounts, Go to:
  • Central Administration >> Security 
  • Under the General Security section, click Configure service accounts. 
Get All Managed Accounts
To view existing Managed Accounts using SharePoint Central Administration:
  1. Select Security from the SharePoint Central Administration page.
  2. On the Security page select Configure managed accounts under General Security.
  3. The Managed Accounts page will list all Managed Accounts registered in SharePoint.
This page lists all of the managed accounts. The date and time for the next password change is shown if you enabled Automatic Password Change.

To view existing Managed Accounts using Windows PowerShell, open the SharePoint 2013 Management Shell and enter Get-SPManagedAccount cmdlet.

Edit a Managed Account
  1. To edit an existing managed account using Central Administration, follow these steps:
  2. Click Security and then select Configure Managed Accounts.
  3. The list of existing managed accounts is displayed. To make changes to the account, Click the edit icon for the managed account.
  4. Click OK to save your changes.
To edit a managed account using PowerShell, use the Set-SPManagedAccount cmdlet. Here is how to change managed accounts password using PowerShell: How to Change Managed Account Password in SharePoint 2013

Removing a Managed Account
Before removing a managed account, you should first make sure this managed account is not associated with any SharePoint services or application pools. To determine if it is in use, edit the managed account and look at the Account Information section to see what farm components are using this account.
Once you’ve confirmed the account is not in use, here is how you can use Central Administration to remove the account.
  1. Click Security and then select Configure Managed Accounts.
  2. Click the delete icon for the managed account you want to remove.
  3. In the Remove Managed Account page, confirm the correct account is selected and click OK.
To remove a managed account using PowerShell, use the Remove-SPManagedAccount cmdlet. E.g.
Remove-spmanagedaccount "Crescent\SP_Farm" 
The above cmdlet, Un-registers the account from SharePoint farm. But doesn't do any delete operation on AD!

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


Friday, September 19, 2014

Create Usage and Health Data Collection Service Application in SharePoint 2013 using PowerShell

Usage and Health data collection service application collects data about end user usage and health of the entire farm. This data is used in Health monitoring and web analytics service. Usage and Health Data Collection Service Application can be only created through PowerShell in SharePoint 2013. You'll get empty reports in Web Analytics reports section, if usage and health data collection service application isn't configured properly.
Usage and Health Data collection database that should not be part of the Availability Group!

Create Usage and Health Data Collection Service Application in SharePoint 2013 using PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Variables
$UsageSAName = "Hosting Farm Usage and Health Data Collection Service"
$DatabaseName = "HostingFarm_Usage_SA"
$DatabaseServer="SP13_SQL"
$UsageLogPath = "D:\UsageLogs\"

#Get the Usage Service Application Service Instance
$ServiceInstance = Get-SPUsageService 

#Create new Usage Service application
New-SPUsageApplication -Name $UsageSAName -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -UsageService $ServiceInstance #> $null

#Create Service Application Proxy..." 
$proxy = Get-SPServiceApplicationProxy | where {$_.TypeName -eq "Usage and Health Data Collection Proxy"}
$proxy.Provision()

#Set Usage Service Application Option
Set-SPUsageService -LoggingEnabled 1 -UsageLogLocation $UsageLogPath -UsageLogMaxSpaceGB 1 
Here is how it appear in Service applications page:
create usage and health data collection service application sharepoint 2013
SharePoint 2013 create usage and health data collection service application PowerShell
Please note, Only one instance of the usage and data collection service application can be created for a SharePoint farm! If you try to create one more, you'll get "A Usage Application already exists in this farm." error.

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


Thursday, September 18, 2014

SharePoint 2013 Service Accounts List, Permissions and Best Practices

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

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...