SharePoint Alert Me Overview
Auditing SharePoint Alert Me configurations was not always feasible with SharePoint Online. It posed to be a challenge when migrating from SharePoint Server to SharePoint Online as migration tools did not support this functionality. While migration planning, administrators had to inform users to re-create their alerts manually, which could be cumbersome for larger organizations. With the introduction of the assembly update, we know have the ability to audit and manipulate alert settings using the Client Site Object Model (CSOM).
While either working with document libraries or lists, the end user has the ability to subscribe to change notifications whenever they would like. They act as a digest of information about what is going on within their environment. Alerts may only be configured at the list or library level so if there is a need to monitor an entire site, an administrator would have to leverage the SharePoint audit log settings.
Release Date: January 2017
Release Version: 16.1.6112.1200
SharePoint Alert Me CSOM
While working with alert settings, administrators have the ability to audit:
- Display Name
- Frequency
- Type
- Alert Notification Delivery Time
- Trigger Event Type
- Delivery Method
#Set Global Variables $username = Read-Host "Enter Username (ex. user@contoso.com): " $password = Read-Host "Enter Password: " $siteUrl = Read-Host "Enter Site URL (ex. https://contoso.sharepoint.com): " #Gets the Current Script Directory Function Get-ScriptDirectory { $Invocation = (Get-Variable MyInvocation -Scope 1).Value Split-Path $Invocation.MyCommand.Path } #Load DLLs $directory = Get-ScriptDirectory; Set-Location $directory #provide DLLs with the script Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.dll") Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.Runtime.dll") #Set Credentials $secstr = New-Object -TypeName System.Security.SecureString $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)} $AdminCred = new-object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $secstr) #Create Client Context $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) $ctx.Credentials = $AdminCred $ctx.Load($ctx.Web) $ctx.Load($ctx.Web.Alerts) $ctx.ExecuteQuery() foreach ($alert in $ctx.Web.Alerts) { $ctx.Load($alert.User); $ctx.ExecuteQuery(); #get the alert write-host $alert.User.LoginName -ForegroundColor Yellow; write-host "AlertTitle :`t" $alert.Title; write-host "AlertFrequency :`t" $alert.AlertFrequency; write-host "AlertType :`t" $alert.AlertType; write-host "AlertTime :`t" $alert.AlertTime; write-host "EventType :`t" $alert.EventType; write-host "AlwaysNotify :`t" $alert.AlwaysNotify; write-host "DeliveryChannels:`t" $alert.DeliveryChannels; }
Reference: Microsoft.SharePoint.Client.Alert