Thursday, January 22, 2015

Powershell Commands



New ULS Logs file
Use the below command when ever you want to create a new new Log file.
This is very helpful while investigating an issue. To get ULS logs for 30 seconds, execute the below command twice at starting and end of 30th second, so you will have a separate log file for the time period.
New-SPLogFile


Merge URLs Logs:
Combines trace log entries from all farm computers into a single log file on the local computer.

Merge-SPLogFile -Path <String> [-Area <String[]>] [-AssignmentCollection <SPAssignmentCollection>] [-Category <String[]>] [-ContextFilter <String[]>] [-Correlation <Guid[]>] [-EndTime <DateTime>] [-EventID <String[]>] [-ExcludeNestedCorrelation <SwitchParameter>] [-Level <String>] [-Message <String[]>] [-Overwrite <SwitchParameter>] [-Process <String[]>] [-StartTime <DateTime>] [-ThreadID <UInt32[]>]

Tuesday, November 11, 2014

SharePoint Event Receivers that are running on a List

It is tough to find out running "Event Receivers" for a SharePoint list.
Here is a way using Power Shell script to know the Event Receivers bound to a List:

$web = Get-SPWeb -Identity "http://pc.gn.com/sites/CO"
$list = $web.Lists["Order List"]
$list.EventReceivers


Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$spWeb = Get-SPWeb -Identity "http://pc.gn.com/sites/CO"
$spList = $spWeb.Lists["Order List"]
$evts = $spList.EventReceivers
$evts
Write-Host("..." + $evts.Count)
if ($evts.Count -gt 0) {
            foreach ($evt in $evts) {
                Write-Host("..." + $spList.RootFolder.ServerRelativeUrl + ", " + $evt.Type)
            }
        }


TO delete an event receiver from a List:
Once you confirm  the event receivers, use below to delete them
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$spWeb = Get-SPWeb -Identity "your site url"
$spList = $spWeb.Lists["TrackTravel"]
$evts = $spList.EventReceivers | where {$_.Assembly -eq ""your assembly"}
$evts
if ($evts.Count -gt 0) {
            foreach ($evt in $evts) {
                Write-Host("Deleting..." + $spList.RootFolder.ServerRelativeUrl + ", " + $evt.Type)
                $evt.Delete()
            }
        }

And the other way is:
To know the Event Receivers bound to a List and Events that ran on a List Item (Title: MI4803)
USE WSS_Content_XXX
SELECT * FROM EventReceivers WITH (NOLOCK)
where Class like 'GN.SP2010%'

select * from dbo.EventLog
where ListId = '1648253C-ED8F-44AE-B2EB-A19238102B41'
and ItemName = 'MI4803'

Thursday, April 24, 2014

Reports with SharePoint List as data source

[Draft}

One easy way to generate dynamic reports/metrics based on SharePoint List as data source is using SharePoint Designer and various List Views.

Other easiest way is using SSRS services on SharePoint and Report Builder 3.0 as report development tool.

To create reports using Report Builder 3.0 go through the link:

1. Install SQL Server Reporting Services with SharePoint Integration Mode and attach to the SharePoint Form. or install SSRS with SharePoint Integration Mode on any of the existing SharePoint Server.

2. Enable Reporting Services on SharePoint Form in Central Administration and make sure it is running and you can see SSRS related section on Central Administration.

3. Enable the below highlighted features and PerfornamcePoint Services to use PerformancePoint Dashboards/ScoreCards/KPI etc.




4. Create a document library and enable Content Types and add Reporting services related content types as described in this link.

Create A SharePoint Document Library To Store SSRS Reports



Reports in SharePoint - draft


You have various ways to create reports on SharePoint based on the various data sources like SharePoint List/Library as data source or external data sources like SQL Server/Oracle DB.

If the Oracle DB as your data source the only way to create reports and use in SharePoint is use some external reporting tools like Cognos/SAP BO/ etc and integrate them with SharePoint with the help of integration components.

If the data source is a SQL Server, you can use SSRS which has easy integration with SharePoint.

If the data source is SharePoint Lists/Library, you can use SSRS and Report Builder 3.0 as report development tool.

Document Library VS Record Library


 A Records Library is a document library but with a Records Management slant. It is available in the Records Center site by default but won`t be available in any of the other site templates.

Record library is a document library configured to "allow multiple content type", "Document check out before editing", "Versioning" etc.. including "Automatically declare items as records when they are added to this list".  So when a document is uploaded to a Record library it is declared as a record and there by deletion can be prevented. There is a new feature in SharePoint 2010 called In Place Records Management. This allows certain SharePoint documents (or blogs, wikis, web pages, and list items) to be declared records. The system can prevent such records from being deleted or edited.  For more details ...

Document Library Planning



Tuesday, April 1, 2014

Display a Sub-Site List on a Top Level Site


Edit the List/library on SharePoint Designer 2010 and open any of the view.
Select the list webpart and on ribbon under webpart tab, at save webpart section select "To File".
Save to your desktop.

Open the webpart page and upload it and add the webpart to the page. You are done...

http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=76

I like the above post for displaying subsite lists/libraries on parent sites..
But it did not work when I try to place the webpart on Wiki page, however it worked when I place the web part on a Webpart page.

Friday, March 7, 2014

Inserting/editing multiple items into SharePoint 2010 List at once


You cannot do if you go with traditional way of customizing SharePoint List with InfoPath 2010.

Instead you can insert multiple items into SharePoint List at once by creating the InfoPath Form from InfoPath form SharePoint List templates.

There is a very good article on this from Andrej... however, he did not explain how to edit multiple records at a time in InfoPath (other than editing in datasheet).

The requirement is I need to edit multiple records based on a parameter.
Any ideas would be appreciated on this...