Monday, 28 November 2016

How to check version of App Fabric or Distributed Cache

With post we like to share how easy it is to find App fabric or Distributed cache version.

So lets get started :)

The easiest way is to manually check what version of App Fabric you are using or CU applied to App Fabric

 Go to Control Panel  > Program and Features. Check for App Fabric and you can see the version.

Second way is thru PowerShell.

Run below cmd to get the details about App Fabric a.k.a Distributed cache.

(Get-ItemProperty "C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules\DistributedCacheConfiguration\Microsoft.ApplicationServer.Caching.Configuration.dll" -Name VersionInfo).VersionInfo.ProductVersion

Happy SharePointing :)

Thursday, 24 November 2016

WSS Usage Application proxy stopped on SharePoint

This post help you with Issue where Usage and Health Data Collection proxy is stopped on SharePoint.

This applies to SharePoint 2013 and 2016

Below screenshot for reference .

Resolution :

Follow below steps to Start the proxy application.

1. Get the ID for  Usage and health Application using this cmd "Get-SPServiceApplicationProxy".

2. Now use below Powershell cmd to start it

$Usage= Get-SPServiceApplicationProxy | Where{$_.ID -eq "f4cd8349-a2ba-4c66-96da-2ffa84b32b19"}

3. Now Check Usage and Health Data Collection proxy will be started.

Happy SharePointing :)

Adding Certificate to Manage Trust in Central Administration.

This Post will help you out with the steps on how to export the certificate which is associated with site and then add it to Manage Trust in Central Administration.

So lets get started :)

1. First of all browse your site.Click on Lock and Click View Certificate.

2. Go to Certification Path and Select the Root of the Path and Click On View Certificate.

 3. It will open a new certificate, go to Details tab and Click on Copy to File.

4. It will open a Certificate Export Wizard and Click Next.

5. Click Next and Give a name to the file. Click Finish. Certificate will exported.

6. Now,Cert is exported.Go to Central Admin > Security > Click Manage trust.

7. Click New and Fill out the details.

8. Now Certificate has been added in Manage Turst.

9. Do an I.E reset.

Now, you wont get any certificate error while browsing the site.

Happy SharePointing :)

Tuesday, 22 November 2016

PowerShell to replace the old content type with new one.

One of our user came up with a request to change all the old content type with the new one.

If you do google you will find lots of resource which can help you achieve it.

But our user had special request while changing the content type, the modified by or modified time should not be changed.

Below is the PowerShell to achieve it.

Add-PSSnapin Microsoft.SharePoint.PowerShell

#Custom PowerShell Function to switch Content type of all items stored in a SharePoint library

Function Change-ItemContentType {
        [Microsoft.SharePoint.SPWeb]$Web = $(throw "Please provide the 'Web' Parameter!"),
        [string]$ListName = $(throw "Please provide the 'ListName' Parameter!"),
        [string]$OldContentTypeName = $(throw "Please provide the 'OldContentTypeName' Parameter!"),
        [string]$NewContentTypeName = $(throw "Please provide the 'NewContentTypeName' Parameter!")
    #Get the list
    $List = $Web.Lists[$ListName]

    #Get the new content type
    $NewContentType = $List.ContentTypes[$NewContentTypeName]
    #Iterate through each item in the list
    foreach($item in $list.Items)
        if($item.ContentType.Name -eq $OldContentTypeName)
            #Change the content type
            $item["ContentTypeId"] = $NewContentType.Id
            Write-host "Content type changed for item: "$

#Variables for processing
$WebURL ="Site URL"
$ListName ="Library Name"
$ContentTypeName ="New Content type Name"

#Get the Web and List
$Web = Get-SPWeb $WebURL
$List = $Web.lists.TryGetList($ListName)

if($list -ne $null)
    #Call the function to add content type
    Change-ItemContentType $web $list "Old Content type Name" "New Content type Name"

Happy SharePointing :)