Posts

Send Email with multiple attachments in SharePoint List

Image
There is no direct implementation for this functionality and can't send attachments in SharePoint Designer Workflow so I have implemented the Custom Event Receiver for SharePoint List and added this code under "ItemAdded" 1) Create SharePoint Custom List (example: EmailNotificationLog) 1) Create Farm level project and select Event Receiver Project in VS 2010/2012 and name it (I used the name to "SendEmailwithAttachment") 2) Open "Elements.xml" file and change Receivers tag with below  <Receivers ListUrl="Lists/EmailNotificationLog" Scope ="Web"> 3) Add Microsoft.SharePoint reference to project 4) Open .cs file and add the below code under ItemAdded using System; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePoint.Utilities; using Microsoft.SharePoint.Workflow; using System.Net.Mail; namespace SendEmailwithAttachment.SendEmailwithAttachmentEventReceiver { public class Sen...

Exploring SharePoint Users, Groups, and Security Using PowerShell

Image
Here's a quick little PowerShell script to list all groups and all users. Note that if an AD group is listed as a user, all the users in that group may not show up in this list until the user has visited SharePoint at least once. For both SharePoint 2007 or 2010 in any PowerShell: [System.Reflection.Assembly]::LoadWithPartialName( "Microsoft.SharePoint" ) $site = New-Object Microsoft.SharePoint.SPSite( "http://yourservername/sites/yoursitecollection " ) $groups = $site.RootWeb.sitegroups foreach ($grp in $groups) { "Group: " + $grp.name; foreach ($user in $grp.users) { " User: " + $user.name} } $site.Dispose() or for SharePoint 2010 in the SharePoint 2010 Management Shell: $site = Get-SPSite http: //yourservername/sites/yoursitecollection $groups = $site.RootWeb.sitegroups foreach ($grp in $groups) { "Group: " + $grp.name; foreach ($user in $grp.users) { " User: " + $user.name} } $site.Dispo...

List All Checked Out Items Using PowerShell - SharePoint 2010

Image
http://www.topsharepoint.com/list-all-checked-out-items-using-powershell ----------------------------------------- If you’re in need of a report on checked out files across specific SharePoint site, and if you’re an administrator it is just a matter of time until someone will ask you for it, here is a simple but very useful PowerShell script that displays the report organized into few fields: site URL, who checked it out, since when was checked out, author’s name, file size and email address of the person who checked out the file. The result will be shown in the Management Shell Grid Viewer or you can output the report to a text file. # enter your site URL $spWeb = Get-SPWeb "http://sp2013"   function GetCheckedItems ( $spWeb ) { Write-Host "Scanning Site: $($spWeb.Url)" foreach ( $list in ( $spWeb. Lists | ? { $_ - is [ Microsoft. SharePoint . SPDocumentLibrary ] } ) ) { Write-Host "Scanning List: $($list.RootFolder.ServerRel...