Pages

Wednesday, October 11, 2017

Find SharePoint List Column available via SharePoint Server Side Code



you can use Fields.ContainsField to check if the List Column exists from the custom List, So that, you can avoid error for running Custom Code Webpart.



if(reqReadlist.Fields.ContainsField("RequestID"))
{
  LogMessage("RequestID " + Reqitem["RequestID"], EventLogEntryType.Error);

  dr["Requisition No"] = Convert.ToString(Reqitem["RequestID"]);
}
else
{
    LogMessage("Not Available RequestID ", EventLogEntryType.Error);
}

Thursday, August 3, 2017

Tuesday, June 13, 2017

Using PowerShell to Get SharePoint Content database size

To get the all CONTENT_DB  size in SHAREPOINT server(MB), Using below commands power shell commands.


Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}} >c:\Content_DBsize.txt

The above code will export to C drive and you can change drive for your requirement.