SharePoint – Get all alerts from a specific SP List/Library using Powershell

Hey Everyone!!!

Today i will talk about List and Library Alerts and how can you get all Active alerts for a specific list using powershell script and how can you disable all alerts.

This is very useful script, when you need move a large list of items on a maintenance routine and you don’t want send a large number of emails/ notifications for users who subscribe alerts, this script help you disable and enable them.

This first PowerShell Script get all SharePoint list alerts with state active.

 

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$WebURL = "http://YourWebUrl"
$ListName="YourListName"

#Function to Get All Active Alerts on a Given List
Function Get-ListAlerts($WebURL, $ListName)
{
  #Get the Web and List objects
  $Web = Get-SPWeb $WebURL
  $List = $web.Lists.TryGetList($ListName)

  #Get All Alerts created in the list - Which are Active
  $ListAlerts = $Web.Alerts | Where-Object {($_.List.Title -eq $List.Title) -and ($_.Status -eq "ON")}

  foreach($Alert in $ListAlerts)
  {
          write-host "Alert' - $($Alert.Title)' Created for User - '$($Alert.User.Name)'"
  }

 #Dispose web object
 $Web.Dispose()
}

#Call the function Appropriately to Disable or Enable Alerts 
Disable-ListAlerts $WebURL $ListName

 

 

If you want disable all alerts on this specific list you just need run the following script.

 

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$WebURL = "http://YourWebUrl"
$ListName="YourListName"

#Function to Disable All Active Alerts on a Given List
Function Disable-ListAlerts($WebURL, $ListName)
{
  #Get the Web and List objects
  $Web = Get-SPWeb $WebURL
  $List = $web.Lists.TryGetList($ListName)

  #Get All Alerts created in the list - Which are Active
  $ListAlerts = $Web.Alerts | Where-Object {($_.List.Title -eq $List.Title) -and ($_.Status -eq "ON")}

  Write-host "Total Number of Active Alerts Found in the list: $($ListAlerts.Count)" 
 
  #Iterate through each alert and turn it OFF
  foreach($Alert in $ListAlerts)
  {
     $Alert.Status="OFF"
     $Alert.Update()
     write-host "Disabled the Alert' $($Alert.Title)' Created for User '$($Alert.User.Name)'"
  }
 
 #Dispose web object
 $Web.Dispose()
}

#Call the function Appropriately to Disable or Enable Alerts 
Disable-ListAlerts $WebURL $ListName

 

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SharePoint – Using Flows on yours list items and documents

Hey Everyone!!

Today i will talk about Flows!!! March 2017 bring us a new capabilities about integrating Flows with modern libraries, allowing you create interactive in document libraries and list! Probably they will quickly replace the old Event Handler or Event Timer Jobs!…

Flows, introduce a new way to development scheduler to build and respond your business needs, it is very fast to implement them and very intuitive!…with the ability to build zero code processes directly from a SharePoint list. These Flows operate against the entire scope of a list, waiting for data-or driven triggers to launch each process. Flows operate on a single item or document selected in the modern user experience.

You could create Flows using templates or you could create your owns directly inside SharePoint. Selecting a Flow launches the browser based Flow designer. When you save the Flow it’s also added as a drop-down button in that list or library.

Take a look at the flow templates list that you can use:

https://flow.microsoft.com/en-us/services/shared_sharepointonline/sharepoint/

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SharePoint Online – Storage Metrics – Monitor storage usage in your Site Collection

Hey Everyone!!!

Today i will talk about Storage Metrics in your SharePoint Site Collection!!!

Everyone knows what is the main feature on SharePoint that you could interact with and Structure of SharePoint Site Collections! right!? Site Content and Struct (/_layouts/sitemanager.aspx)!!!

Site Content and Structure page, give you a great overview about all your Site Collection structure. This feature, available since Microsoft Office SharePoint Server 2007, give the capability to navigate dynamically on your site collection hierarchy, it is familiar to Windows Explorer in fact. You can see the site collection hierarchy in the navigation pane as a tree view on the left of the Site Content and Structure page.

But, if you need know more details about storage, probably don’t help you as you expect, so in this case you case access to Storage Metrics (/_layouts/storman.aspx).

 

Storage Metrics underneath Site Collection Administration, access to your all sub-sites and libraries in SharePoint Online ( also available for SharePoint 2010, SharePoint 2013 and SharePoint 2016) and give you the information about how much storage they are consuming.

It is great!!! Because Storage Metrics allows you to drill down to each site, library and even folder to show a very granular report on your storage consumption, this is very important if you need migrate a large lists or even you are planning an migration between SharePoint Versions without any 3rd Party tool.

Take a Look:

 

 

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|