Export SharePoint User Alerts using C#

Hello friends, in this blog article we will see how we can export all the user alerts from SharePoint Online Site. It will export the list of user alerts from defined site collection in CSV format. The exported data will contain all the details about user and his alerts like on which lists he subscribed for the alerts, frequency of the same.

We know that we can see a list of user alerts from site settings > User alerts. But it has some limitations like a number of users. It won’t provide the list of all users once it crossed the specified limit. So to export all user alerts, we need to write either PowerShell or some console application.

Here are steps to get all alerts from SharePoint online site. You can tweak the code according to your need.

1) Open Visual Studio 2013
2) Create Window console project
3) Open Tools → NuGet Package Manager → Package Manager Console
4) Run following command in the console

Install-Package Microsoft.SharePointOnline.CSOM -Version 16.1.7317.1200

5) Add following code in the main class

using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;

namespace Alerts {
    class Program {
        static void Main(string[] args) {

            string targetSiteURL = @ "https://myclassbook.sharepoint.com/sites/test123";
            var login = "[email protected]crosoft.com";
            var password = "XXX";
            var securePassword = new SecureString();

            foreach(char c in password) {

            SharePointOnlineCredentials onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
            ClientContext ctx = new ClientContext(targetSiteURL);
            ctx.Credentials = onlineCredentials;
            var users = ctx.Web.SiteUsers;
            var csv = new StringBuilder();

            foreach(var user in users) {
                var alerts = user.Alerts;
                if (alerts.Count > 0) {
                    csv.AppendLine(string.Format("Display alerts for {0}({1})", user.Title, user.LoginName));
                    foreach(var alert in alerts) {
                        csv.AppendLine(string.Format("Frequency:{0}, Delivery Method(s):{1}, AlertName:{2}", alert.AlertFrequency, alert.DeliveryChannels, alert.Title));
            System.IO.File.WriteAllText("C:\\Alerts\\alerts.csv", csv.ToString());

6) Change Url and login details. Resolve references
7) Add “Alerts” folder in C: drive
8) Run code

See also: Manage, view, or delete SharePoint alerts

I hope you liked this article. Please share it with your friends and like our facebook page. If you have any queries, feel free to ask in the comment section below.

Block Diagram Algebra

Hello friends, in this blog article, we will learn Block diagram algebra in the control system. It will include block diagram reduction rules, some block diagram reduction examples and solutions.

We know that the input-output behavior of a linear system is given by its transfer function: G(s)=C(s)/R(s)

where R(s) = Laplace transform of the input variable and C(s) is Laplace transform of the output variable

A convenient graphical representation of such a linear system (transfer function) is called Block Diagram Algebra. 

A complex system is described by the interconnection of the different blocks for the individual components. Analysis of such a complicated system needs simplification of block diagrams by the use of block diagram algebra. Below table showing some of the rules for Block Diagram Reduction.

Block Diagram Reduction Rules

Block diagram reduction rules help you to minimize the block diagram thus solving the equations quickly. Below table represents block diagram reduction rules in the control system

Using the above rules you have to follow below simple steps to solve the block diagrams:

1. Combine all cascade blocks
2. Combine all parallel blocks
3. Eliminate all minor (interior) feedback loops
4. Shift summing points to left
5. Shift takeoff points to the right
6. Repeat steps 1 to 5 until the canonical form is obtained

Block diagram reduction examples

Now we will see some block diagram reduction examples. We will start with some simple examples and then will solve a few complex ones.

Example 1: In the below example, all the three blocks are in series (cascade). We just need to multiply them as G1(s)×G2(s)×G3(s).


Example 2: In this example, two blocks are in parallel but there is one summing point as well.


Example 3: Solve the below block diagram

Example 4: Simplify the block diagram shown in Figure below.


Step 1: Moved H2 before G2

Step 2: H1 and G2 are in parallel, thus added them as below

Step 3: (H1+G2) and G3 are in series, thus multiplied them

Step 4: Moved takeoff point 2 after G3(G2+H1)

Step 5: Minimizing parallel block with a feedback loop

Step 6: Finally, we will get the minimized equation as below

I hope you liked this article. Please share this with your friends. Like our facebook page and subscribe to our newsletter to get daily updates. Please let us know about your queries in the comment section below. Have a nice time 🙂

Tags: block diagram algebra pdf, block diagram algebra solver, block diagram algebra problems, block diagram reduction examples and solutions, block diagram reduction examples pdf, block diagram tutorial, block diagram questions, control systems block diagram reduction problems.

Measurement of resistance

Hello friends, in this blog article we will learn different methods for the measurement of resistance. We will first see, what are the different types of methods in short and will explain the same in details in separate blog articles.

Measurement of Resistance

Before learning different types of methods for measurement of resistance, we will first see the classification of resistance. From the point of view of measurement, we have three types of resistances as follows:

  1. Low resistances: < 1Ω
  2. Medium resistances: 1Ω to 100,000Ω
  3. High resistances: >100,000Ω

A. Measurement of Low resistance

  1. Ammeter-Voltmeter method
  2. Kelvin’s double bridge method
  3. Potentiometer method
  4. Ducter

B. Measurement of Medium resistance

  1. Ammeter-Voltmeter method
  2. Substitution method
  3. Wheatstone bridge method
  4. Ohmmeter method

C. Measurement of High resistance

  1. Direct deflection method
  2. Loss of Charge method
  3. Megohm bridge
  4. Megger