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]";
            var password = "XXX";
            var securePassword = new SecureString();

            foreach(char c in password) {
                securePassword.AppendChar(c);
            }

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

            foreach(var user in users) {
                var alerts = user.Alerts;
                ctx.Load(alerts);
                ctx.ExecuteQuery();
                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 in control system

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.

Solution:

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.

Fire Alarm Circuit using IC555 Mini-project

Hello friends, today we are going to make one simple mini project which is a fire alarm. In this mini project, we will make a fire alarm circuit using a timer IC (IC555) and thermistor. Here we are using a thermistor sensor to sense the fire. The working principle of fire alarm circuit depends upon working principle of a thermistor (i.e. thermistor changes its resistance as temperature changes). Thus when a temperature of thermistor increases because of fire its resistance also changes.

Fire Alarm Circuit using IC555 Mini-project

Circuit diagram:

The following figure shows the circuit diagram of fire alarm using IC 555 mini project:

Fire Alarm Circuit using IC555
Circuit diagram for Fire Alarm using IC555

Components:

Following components are required for making fire alarm circuit (mini project).

  • VR1 = 10KΩ Variable Resistor which is used for varying the sensitivity of the circuit.
  • R3, R7, R8 = 470Ω
  • R2 = 33 KΩ
  • R4 = 560 Ω
  • R5 = 47 KΩ
  • R6 = 2.2 KΩ
  • C1 = 10 µF/16V
  • C2 = 0.04 µF
  • C3 = 0.01 µF
  • IC1 = NE555 (timer IC)
  • T1 = BC548
  • T2 = BC558
  • T3 = SL100B or (NPN transistors like 2N4922 , 2N4921,2N4238)
  • D1 = 1N4001
  • TH1 = Thermistor 10 KΩ
  • LS1 = 8 Ω, 1W speaker

Working of fire alarm circuit:

In this fire alarm mini project three components are very important i.e. thermistor, IC 555 (which is timer IC) and a third one is a transistor which is used to drive the circuit.

The timer IC used in this circuit works as an astable multivibrator oscillator which is used to oscillate in the audio frequency band. As stated earlier timer IC is driven by two transistors T1 and T2. The frequency of timer IC 555 depends upon the values of resistors R5 and R6 and capacitor C2. The loudspeaker which is used for fire alarm is connected to the pin no 3 of timer IC through transistor T3.

When the temperature of thermistor increases it causes a low resistance path for a current flowing towards the base of the transistor.

For this type of fire alarm circuit, we can use a power supply of 6V to 12V.

Tips:

1) Thermistor does not have polarity.

bead type thermistor
bead type thermistor

2) The following figure shows the pinout diagram of timer IC 555:

IC 555 Pin configuration
IC 555 Pin configuration

You may also like:

I hope you liked this article. If you have any queries, please use below comments section for the same. Please like our facebook page and subscribe to our newsletter for future updates. Have a nice day! tada…

Measurement of resistance [Learn ALL methods easily]

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
Measurement of resistance

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 resistance: < 1Ω
  2. Medium resistance: 1Ω to 100,000Ω
  3. High resistance: >100,000Ω

A. Measurement of Low resistance

1. Ammeter-Voltmeter method: This is a very popular method for measurement of medium resistances since instruments required for this method are usually available in the laboratory.

2. Kelvin’s double bridge method: The Kelvin double bridge is the modification of the Wheatstone bridge and provides greatly increased accuracy in measurement of low-value resistance.

3. Potentiometer method: The potentiometer is extensively used for calibration of voltmeters and ammeters and has, in fact, become the standard for the calibration of these instruments.

4. Ducter

B. Measurement of Medium resistance

1. Ammeter-Voltmeter method

2. Substitution method: This is a more accurate method than ammeter-voltmeter method. The accuracy of this method is greatly affected if the emf of the battery changes during the time of readings.

3. Wheatstone bridge method: Another method of measuring the value of a resistor is the Wheatstone bridge. This device sets up a parallel resistor system that measures the differences in voltage between two legs of a circuit. If there is a difference of voltage between the branches it will be detected by the galvanometer.

4. Ohmmeter method

C. Measurement of High resistance

1. Direct deflection method: Direct deflection method for measurement of high resistance

2. Loss of Charge method: In the loss of charge method unknown resistance is connected in parallel with the capacitor and electrostatic voltmeter. The capacitor is initially charged to some suitable voltage by means of a battery of voltage V and then allowed to discharge through the resistance.

3. Megohm bridge: Megohm bridge is another important method for measurement of high resistances. It has one three terminal high resistance located in one arm of the bridge.

4. Megger: We know that the ratiometer ohmmeters may be designed to cover a wide range of resistances. The principle of ratiometer ohmmeters is particularly adapted to application in portable instruments measuring insulation resistance. This principle forms the basis of insulation testing instrument known as Meggar.

I hope you liked this article. If you have any queries, please use below comments section for the same. Please like our facebook page and subscribe to our newsletter for future updates. Have a nice day! tada…