Friday 17 July 2020

Hide Time from events in Calendar list or webpart

Use below code in content edit webpart or by editing list page in SharePoint designer

<style type="text/css">
.ms-acal-time {
display: none;
}
</style>

Tuesday 30 January 2018

SharePoint list inventory using Powershell script


if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

function GetListInventory($siteUrl)
{
    $webApp = Get-SPWebApplication $siteUrl
 
    $SiteDetail = @();

    Foreach ($web in $webApp | Get-SPSite -Limit All | Get-SPWeb -Limit All)
    {
       Write-host "Processing site $web.Name..."

            foreach($list in $web.lists)
            {
             $row = new-object PSObject
                Add-member -inputObject $row -memberType NoteProperty -Name "Site Name" -value $web.Name
                Add-member -inputObject $row -memberType NoteProperty -Name "URL" -value $web.Url
                Add-member -inputObject $row -memberType NoteProperty -Name "List Title" -value $List.Title
                Add-member -inputObject $row -memberType NoteProperty -Name "List Item Count" -value $list.ItemCount
#Add-member -inputObject $row -memberType NoteProperty -Name "List Item Count" -value $list.Items.Count
                Add-member -inputObject $row -memberType NoteProperty -Name "Last Modified Date" -value $List.LastItemModifiedDate
                if ($list.EnableVersioning -eq $TRUE)
                {
                Add-member -inputObject $row -memberType NoteProperty -Name "Versioning" -value "Yes"
                }else
                {
                Add-member -inputObject $row -memberType NoteProperty -Name "Versioning" -value "No"
               
                }
                $SiteDetail += $row;

            }

       

    }
    $SiteDetail
}

GetListInventory "http://SPFarm2016" | Export-Csv -NoTypeInformation -Path C:\ListInventory.csv
#GetListInventory "http://SPFarm2016" |  Out-File "E:\FMT\ListInventory.csv"


Wednesday 30 August 2017

How to Embed PDF document or PPT in web-part in SharePoint


Solution: If you want to display a PPT slide in webpart, use page viewer web part, for more info check this link http://www.nothingbutsharepoint.com/2011/12/07/display-a-powerpoint-document-in-sharepoint-via-the-page-viewer-web-part-aspx/ 

and to display a PDF document in web-part, use content editor webpart and use below code:

<object><embed src="FILENAME.PDF" height="850" width="850"
 type="application/pdf"></embed></object>


http://blog.bonzai-intranet.com/analysthq/2011/03/embedding-pdfs-into-sharepoint-2010-pages/



Wednesday 16 August 2017

SharePoint Web Analytics service not showing any data "Solution"


Web Analytics service in SharePoint was not showing any data, all the values were showing as zero. The main reason might be that the data may not be flowing to logging DB or Staging DB.

Below are the few checks to start the troubleshooting process:


  • Check the web analytics service is running in central admin.
  • Check the timer job status.
  • Check event logs in all servers including DB server.

In my case we had this below error in the event logs of DB server:

"The Execute method of job definition Microsoft.SharePoint.Administration.SPUsageImportJobDefinition (ID GUID) threw an exception. More information is included below.
An update conflict has occurred, and you must re-try this action. The object SPUsageServiceInstance was updated by domain\serviceaccoutn, in the OWSTIMER (ID) process, on machine SharePointFrontEndServer. View the tracing log for more information about the conflict."

and which is why the analytics report was showing zero numbers. To fix this issue, we followed some steps to clear cache files from all the servers(WFE and App server) and restart SharePoint timer service.

Below are the steps to fix this:


To resolve this issue, clear the file system cache on all servers in the server farm on which the Windows SharePoint Services Timer service is running. To do this, follow these steps:

  • Stop the Timer service. To do this, follow these steps:
  • Click Start, point to Administrative Tools, and then click Services.
  • Right-click Windows SharePoint Services Timer, and then click Stop.
  • Close the Services console.
  • On the computer that is running Microsoft Office SharePoint Server 2007 and on which the Central Administration site is hosted, click Start, click Run, type explorer, and then press ENTER.
  • In Windows Explorer, locate and then double-click the following folder:
  • Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID
  • Notes
  • The Drive placeholder specifies the letter of the drive on which Windows is installed. By default, Windows is installed on drive C.
  • The GUID placeholder specifies the GUID folder.
  • The Application Data folder may be hidden. To view the hidden folder, follow these steps:
  • On the Tools menu, click Folder Options.
  • Click the View tab.
  • In the Advanced settings list, click Show hidden files and folders under Hidden files and folders, and then click OK.
  • In Windows Server 2008, the configuration cache is in the following location:
  • Drive:\ProgramData\Microsoft\SharePoint\Config\GUID
  • Back up the Cache.ini file.
  • Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt. 


Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.

  • Double-click the Cache.ini file.
  • On the Edit menu, click Select All.
  • On the Edit menu, click Delete.
  • Type 1, and then click Save on the File menu.
  • On the File menu, click Exit.
  • Start the Timer service. To do this, follow these steps:
  • Click Start, point to Administrative Tools, and then click Services.
  • Right-click Windows SharePoint Services Timer, and then click Start.
  • Close the Services console.
  • Note The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
  •  Make sure that the Cache.ini file has been updated. For example it should no longer be 1 if the cache has been updated.
  • Click Start, point to Programs, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.
  • Click the Operations tab, and then click Timer job status under Global Configuration.
  • In the list of timer jobs, verify that the status of the Config Refresh entry is Succeeded.
  • On the File menu, click Close.

Hope this will fix your issue.

Reference : https://support.microsoft.com/en-us/help/939308/error-message-when-you-try-to-modify-or-to-delete-an-alternate-access

Friday 23 June 2017

Can not add the user because a user with that name already exists : SharePoint

Issue:   

When trying to add user to SharePoint site, getting error

"Can not add the user because a user with that name already exists "

Solution: 

User needs to be deleted from Site collection users, for that go to Top level site. Now  Go to - Site Settings - Site Administration Under Site Collection Administrator - View Site Collection user information and delete the user from there. Then add the user back

You can directly open this page by using this URL as well : http://site/_layouts/1033/siteusrs.aspx

Hope this helps!!


Wednesday 14 June 2017

User unable to access on default.aspx page in SharePoint 2010


Issue: 


Recently we faced a very strange issue, one of our user was not able to access the site with contribute access. 


Troubleshooting steps: 


First and foremost step is to remove user and add it again. sometimes this option works.
Secondly i tried giving full control to user but still user was not able to access the site. I tried adding user to site collection admins but still no luck.

Then I tried checking the access denied URL , this URL shows which component of the site is denying the access with its GUID. This showed me that it was shared documents which was denying access to user, and there was a webpart on the main page of site which was showing documents from shared folder on default.aspx page. So basically it was a webpart which was causing the access issue.

So the conclusion is either you can remove webpart and check for access or identify with the URL which component is causing access issue.


Hope this information helps.


Thursday 9 June 2016

CSS Tricks to hide Ribbon & Left Navigation in SharePoint 2010


1) Hiding Left Navigation\ Quick Launch from any Page in SharePoint:


<style type>
/*-Hide quick launch-*/
#s4-leftpanel{
display:none}

.s4-ca{margin-left}
</style>


2) Hiding search box in ribbon from any Page in SharePoint:

#SRSB {display:none}

3) Hiding Site Actions from any page in SharePoint:

<style type="text/css">
#s4-ribbonrow{display:none;}
</style>




Hide Time from events in Calendar list or webpart Use below code in content edit webpart or by editing list page in SharePoint designer ...