Some farm products and patches were not detected

When patching a lot of SharePoint farms, you tend to come across a lot of different issues, I’ve noticed this issue come around more often than most in load balanced farms (which is every farm nearly!).

So the scenario I have a lot is patching 3-6 servers, when patches are applied, I run the PSConfig command or PSConfigUI and this is where the issue happens.

SharePointProductsConfigWizError

From the image above, when I try to run PSConfigUI I get the error, this is after patching all the servers in the farm and waiting to run the config wizard. SharePoint seems to think the rest of the servers in the farm don’t have the patches required however, I’m 100% sure these were installed on each server.

So how would I get SharePoint to understand that every other server in the farm has this patch that’s required? Well after a little digging in PowerShell I’ve found a command that gets the product on a local machine.

Patching1

If you only run this on one server, you’ll notice the error again. To fully correct this, you’ll need to run this on every server you’ve patched in your farm so the config wizard can recognise the patch level applied.

SharePoint Still using old name

So I find this issue comes about a lot of the time for female users, reasons being is when they get married, they take the mans surname. So when their name changes in AD, this doesn’t automatically reflect the same in SharePoint.

When Active Directory Syncs with SharePoint User Profile Service, it also does a sync in parallel with the User Information List (UIL). When new users are added or modified, these users will be added to the UIL. Unfortunately, when user names are changed, this doesn’t always update the UIL and therefore creates a second account for the new updated surname account.

To fix this, we have to merge the accounts together and delete the old one. Without carrying this out, you will probably notice that SharePont still uses your old account which you’ll notice in the top right corner of SharePoint.

So firstly you can check the UIL by going to the url below

http://YOURSITEHERE/_catalogs/users/simple.aspx

Following that, you’ll get a list of users that are in SharePoint, you can also find the users by going to Site Settings, People and Groups. Change the URL at the end to look at MembershipGroupId=0, the full URL can be seen below using my own site.

http://sharepoint-oc/_layouts/15/start.aspx#/_layouts/15/people.aspx?MembershipGroupId=0

From here, you’ll notice two accounts for one user, so we’ll need to merge these using PowerShell and then delete the old.NameChange2

$user = Get-SPUser -Identity “CHIN\MDean” -Web “http://SharePoint-OC/”
Move-SPUser -Identity $user -NewAlias “CHIN\MTravis” -IgnoreSID

The script above moves your old account to the new account with the new surname. Including the permissions that were there.

Once Completed, go to the link below again and delete the old user.

http://sharepoint-oc/_layouts/15/start.aspx#/_layouts/15/people.aspx?MembershipGroupId=0

It might require the user to log out and in for the update however, I’ve seen it just change without needing it sometimes.

How to create a button in SharePoint 2013

So there are a few ways of creating custom buttons in SharePoint however, I like my buttons to be noticeable so I tend not to use the standard button however, I’ve shown below how to create buttons using basicbutton, Bootstrap & CSS.

Buttons1

Basic Button:

Button2

<input type=button onClick=”parent.location=’http://sharepoint-oc/'” value=’Click Here!’>

CSS Button:

Button4

<style>
.link {
background-color: #6666FF;
color: white;
padding: 12px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
}

.link:hover {
background-color: #C1C1FF;
}
</style>
<a href=”http://sharepoint-oc/” class=”link”>Click Here!</a>

Bootstrap Button:

Button3

<button type=”button” onclick=”parent.location=’http://sharepoint-oc'” class=”btn btn-primary btn-lg”>Click Here!</button>

Internet Information Services is not installed – SharePoint Products Configuration Wizard

So in my scenario, I ran a script that takes all SharePoint services offline for when I wanted to start patching, little did I realise (or read the script), it also takes IIS offline to disabled mode.

Once I completed the patching, I ran the SharePoint Products Configuration Wizard, as you do. To which I then came across the screenshot below.

ConfigWiz1

So first off, I know IIS is on the server and SharePoint fully configured so I knew somehow it was disabled. Fortunately I knew where to check this, if you open the start window and type ‘Services’, then look for IIS Admin Service. In my case, this was disabled due to a script I ran, to change this, right click it and go to properties, then set from disabled to Automatic.

ConfigWiz2

Now try running the SharePoint Products Configuration Wizard and see if you experience the same issue. Hopefully you don’t and you progress to the next screen which will look similar to the below!

ConfigWiz3

Creating Service Applications through PowerShell – SP2013

This will be an ongoing post until all are completed. The below PowerShell will show you how to add a service application as well as delete.

For deleting a service application, run the ‘Get-‘ commands first which can all be found below before running the remove in order to find the ID or the name.

Managed Metadata Service Application

Create the App

#Creates a new Application Pool for Managed MetaData Service Application
New-SPServiceApplicationPool -Name “MetaData_AppPool” -Account “CHIN\sp2013farm”
#Creates new Managed MetaData Service Application
New-SPMetadataServiceApplication -Name “MetaDataServiceApp” -ApplicationPool “MetaData_AppPool” -DatabaseName “SP2013-MetaDataDB”
#Creates new Managed MetaData Proxy
New-SPMetadataServiceApplicationProxy -Name “MetaDataServiceProxy” -ServiceApplication “MetaDataServiceApp”

ManagedMetaData2

ManagedMetaData

Delete the App

#Get-SPServiceApplication
#Removes Service Application
Remove-SPServiceApplication “52845e68-e7e1-4a18-b223-b6ea246c302c”#Get-SPServiceApplicationPool
#Removes Service Application Pool
Remove-SPServiceApplicationPool “TestMetaData_AppPool1″#Get-SPServiceApplicationProxy
#Removes Service Application Proxy
Remove-SPServiceApplicationProxy “77b8604b-c465-46a3-95f8-de05a10fa8c7”

 

Excel Services Application

Create the App

#Creates new Excel App Pool
New-SPServiceApplicationPool -Name “Test-ExcelAppPool” -Account “CHIN\sp2013farm”
#Creates new Excel Services Application
New-SPExcelServiceApplication -Name “Test Excel Services Application” -ApplicationPool “Test-ExcelAppPool”

 

Delete the App

#Gets a list of all Service Applications
Get-SPServiceApplication
#Removes Service Application
Remove-SPServiceApplication “d356b611-40b9-4bcd-930b-36e2718675b9″#Gets a list of all Application Pools
Get-SPServiceApplicationPool
#Removes Service Application Pool
Remove-SPServiceApplicationPool “Test-ExcelAppPool”

ExcelServices1

ExcelServices2

ExcelServices3

 

Next App TBC

Create the App

 

Delete the App

 

Event ID 6398 – Unexpected exception in FeedCacheService.ISRepopulationNeeded

So I recently went crawling through some event logs while doing a health check on a SharePoint farm. I noticed this one in particular so I thought I’d investigate further.

DistributedCacheIssue3

The Feed cache service depends on the Distributed Cache Service, so checking if the distributed cache service is running in Central Administration (manage services on server section) is the first step. Tags and document activities are saved only to the Feed Cache, they are not persisted to content databases, so if the distributed cache service is stopped, the tags and document activities are lost. If the Distributed Cache service is started, repopulation occurs when the feed cache repopulation timer job runs every 5 minutes.

So with the information above, I checked the timer jobs that relate to this as well as the service in CA, both were setup correctly. The next step was to look into PowerShell to find out if the Cache host was working to which I found out it wasn’t.

DistributedCacheIssue1

Following the error shown above I thought I’d try and connect to the App Fabric Cluster Configuration and then restart it which thankfully worked.

DistributedCacheIssue2

Running Get-CacheHost again after the restart is complete will show you the Cache Host values.

Either run the timer job manually or wait 5 minutes for it to run then check the event viewer, hopefully the issue is gone!

There are other fixes out there for this however, this is the fix that seemed to work for my environment.

 

How to change SharePoint button display text

Changing the text for a button within SharePoint can be done through JQuery. Some of the requests I’ve had require this to say ‘Send’, ‘Submit’, ‘Cancel Request’ & ‘Back’.

To begin with, open the form you want this change made, for me, I’d like this on the NewForm. The below form is a copy of the new form that I’ve created in SharePoint Designer.

Buttontext

Edit the NewForm page and add a Script Editor Web Part. Copy the code below and paste in the script editor Web Part.  If you’d like the save value to be something other than save, make sure you change the part where I’ve written ‘Send’.

<script>
$(document).ready(function()
{
$(“input[value$=’Save’]”).attr(‘value’, “Send”);
});
</script>

Buttontext2

Save the changes and stop editing the page. Go back into the NewForm (New Item) page and check the changes.

Buttontext3

You can also edit the form in SharePoint Designer and place the code on the form that way.

Create a hyper-link to open in a new window

I get a fair amount of requests to open links in a new window, or just to create hyper-links on lists & libraries. Although this may become obvious for some people, it doesn’t for other newbies in SharePoint. I generally use the ‘Hyperlink with formatting and constraints for publishing’ column. Unfortunately this doesn’t show in the lists/libraries as an option when creating a column. This column has to be done at site level which can be found at Site Settings -> Site Columns (Under Web Designer Galleries).

To create a new column click ‘Create’ and fill in the name of the field and remember to select the correct type of column, screenshot below.

Hyperlink1

Save the column and return to your list.

Within your list go to List settings, towards the bottom of the page select ‘Add from existing site columns’ and you will be presented with the below. Find the column you’ve just created and click add, then click OK.

Hyperlink2

In your list create a new item and click ‘click to add a new hyperlink’, you will then see the fields that require filling out.

Hyperlink3

And lastly, the end result…

Hyperlink4

Reasons for Workflows failing

As I work with workflows I’ll be updating this post as I come across reasons as to why workflows fail to run.


1. Workflow History List Permissions

I’ve recently completed a lengthy approval workflow to which kept failing if an end user created the item, any user in the owners group worked correctly. The users had edit access on the list as well as the tasks list.

I noticed it kept failing at the start of the workflow as I have ‘log to history list’ to help understand where in the workflow I am in case of errors like this, as well as having statuses. I knew for sure users had full edit permissions on the two lists I created however, I didn’t think to check the Workflow History list permissions.

When having ‘log to history list’, users need to be able to edit that list in order for the workflow to log the item to the list which was my issue. I wasn’t using the default members group to group these users, I created my own groups which is why they never had access to that list, giving users access to that list made the approval work as expected.

As the history list is hidden, the easiest way to find this is to type in your SharePoint URL and add /lists/workflow%20history to the end.

https://sharepoint.com/tst/training/lists/workflow%20history

An alternative is to look in SharePoint Designer.
2. TBC