Powershell to get the list of Full Control Users on SharePoint

Powershell to get the list of Full Control Users on SharePoint

To get the full control users of a particular list of sites, first save the list of sites in csv format as below:


Add-Type -Path "C:\Users\mayuresh\Desktop\Data\Old\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Users\mayuresh\Desktop\Data\Old\\Microsoft.SharePoint.Client.dll"
#Add-PSSnapin Microsoft.Sharepoint.Powershell

$admin = "[email protected]";
$password = Read-Host 'Enter Password' -AsSecureString
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($admin, $password)
Connect-SPOService -Url https://myclassbook-admin.sharepoint.com -credential [email protected]

#Setup the context
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webURL)
$ctx.Credentials = $Credentials
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
#get the items from CSV
$inputFilePath = "D:\Mayuresh\MissingOwners\Book2.csv"
$itemCol = Import-Csv $inputFilePath

	$lists = $ctx.web.Lists
	$list = $lists.GetByTitle("SiteUrls")
	$ExslistItems = $list.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery())

    ForEach($EstlistItem in $ExslistItems)
    Write-Host $itemCol -ForegroundColor Cyan
	ForEach ($item in $itemCol)
        $siteURL = $item.SiteUrls
        Write-Host $siteURL -ForegroundColor Cyan

        #Get all Groups from the site permissions
        $sitegroups = Get-SPOSiteGroup -Site $siteURL

        #Get Group info and members that have site owners permissions
        foreach ($sitegroup in $sitegroups)
            #$i = 0
            foreach($role in $sitegroup.Roles)
                if ( $role.Contains(“Full Control”) )
                    $listItemInfo = New-Object Microsoft.SharePoint.Client.ListItemCreationInformation  
                    $listItem = $list.AddItem($listItemInfo)  
                    $listItem["Title"] = $siteURL  
                    Write-Host $sitegroup.Title -ForegroundColor “Yellow”
                    Write-Host $sitegroup.Users -ForegroundColor “Blue”
                    foreach($user in $sitegroup.Users)
                    	$listItem["FullControlUsers"]=$listItem["FullControlUsers"]+"; "+$user;
                    $listItem["FullControlUsers"]=$listItem["FullControlUsers"].TrimStart('; ');
	            write-host "$($_.Exception.Message)" -foregroundcolor red

Download: GetFullControlUsers

Powershell – To add site collection admins in bulk

Hello friends, in this article, we will see how we can assign site collection admin role to multiple user on multiple sites using powershell.

For this you need to summarize the site links and user email address in a csv format as shown below:


Script to set site collection administrator in SP Online
Sets site collection administrators for site collections in SP Online
SharePoint Online Management Shell needs to be installed in local
machine in order to execute the script

Function Check-SiteExists($SiteUrl)
    $errpref = $ErrorActionPreference #save actual error preference
    $ErrorActionPreference = "silentlycontinue"

    return (Get-SPOSite -Identity $SiteUrl) -ne $null

    #return (Get-SPOSite -Identity $SiteUrl) -ne $null
    $ErrorActionPreference = $errpref #restore previous error preference    

Set-ExecutionPolicy Unrestricted -Force

$inputFilePath = "D:\Mayuresh\Sites1.csv"

$credential = Get-Credential

#Adding SharePoint Online Powershell module to the current session.
Import-Module MSOnline

#Connect-MsolService -Credential $credential


#Adding SharePoint Online Powershell module to the current session.
Import-Module Microsoft.Online.SharePoint.PowerShell

#Connects a SharePoint Online global administrator to a SharePoint Online connection
Connect-SPOService -url https://myclassbook-admin.sharepoint.com -Credential $credential

#import csv file containing site collection details
$sites = Import-Csv $inputFilePath
ForEach ($site in $sites)
    $SiteCollURL = $($site.Url)
    $SiteCollectionAdmin = $($site."Site Collection Admin")
        #Add Site collection Admin
        Set-SPOUser -site $SiteCollURL -LoginName $SiteCollectionAdmin -IsSiteCollectionAdmin $False
        Write-Host -ForegroundColor Red "Please check if the user "$SiteCollectionAdmin" is valid"

#Disconnects the SharePoint Online service.

Download: Assign site owner for multiple site

Powershell to unlock SharePoint Online site

Hello friends, below is the script that will help you to unlock your sharepoint online site:

#Change your tenant admin account below
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
$username = "[email protected]"
$password = ConvertTo-SecureString "[email protected]" –asplaintext –force   
#$password = convertto-securestring "YourPassword" -asplaintext -force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $password

#Must be SharePoint Admin URL
$siteUrl = "https://myclassbook-admin.sharepoint.com"
Connect-SPOService -Url $siteUrl -Credential $cred
Set-SPOSite -Identity $site -LockState "Unlock" 


powershell to unlock single site

Integral Controller In Control System

Hello friends, in this article we are going to learn about the Integral controller in Control System with its working.

Integral Controller Working

As we know that, the proportional controller tells us how far to move, to achieve zero error. The integral controller tells us how fast to move to achieve zero error. The proportional controller cannot guarantee zero error in case of a transient change in load dynamics of the system. Integral control accumulates positive and negative errors and tries to eliminate steady-state error.

Integral action is provided by summing the error over time, multiplying that sum by a gain, and adding the result to the present controller output. You can see that if the error makes random excursions above and below zero, the net sum will be zero, so the integral action will not contribute. But if the error becomes positive or negative for an extended period of time, the integral action will begin to accumulate and make changes to the controller output.

Below mathematical expression represents Integral control output,

Integral Controller


  • P(t) = Controller’s output
  • KI= Integral gain usually motioned in terms of integral time (1/Ti)
  • ep (t)= Desired Value of controlled variable – Measured Value
  • dτ = Tiny slices of time
  • P(0) = Initial controller’s output

If we differentiate above equation then,

Above equation shows that when an error occurs, the controller begins to increase or decrease its output at a certain rate that depends on the size of the error and the integral time constant. If the error is zero, the controller output will not change. If there is a positive error, the controller output begins to ramp up at a rate determined.

Integral Controller Applications

There are no specific applications where integral control used individually since integral controller alone will cause transient overshoot and which may result in actuator saturation (means actuator cannot be operated beyond this limit).


  1. Offset error can be eliminated.
  2. Overall system stability increases.


  1. Reset Windup: Due to a sudden change in desired value, there is a huge accumulation of error which will result in high controller output, but as we know that actuator can not react beyond a certain limit, therefore there is no significant change on system’s output. Such a scenario where the action of the controller not able to wind up error due to frequent resetting of actuator known as “Reset wind up” condition.
  1. Phase lag added, which will affect overall settling time of the system.

I hope you liked this article. Please like our facebook page and subscribe to our newsletter for future updates. If you have any doubts, feel free to ask in the comment section below.

Three ammeter method

Three ammeter method for measurement of power:

Following figures shows the circuit diagram and phasor diagram of three ammeter method for measurement of power. The current measured by the ammeter A1, is the vector sum of the load current and that taken by the non-inductive resistor R, this latter being in phase with V.

Three ammeter method
Three ammeter method
three ammeter method 1
three ammeter method 1

From phasor diagram, we have:



  • The advantage of this method is that the value of determined is independent of supply frequency and waveforms.
  • The disadvantages of measurement of power by three voltmeter method are overcome in this method.

Let us solve one numerical based example on three ammeter method for clear understanding.

Example 1:

The following readings were obtained from three ammeters used for a single phase power measurement: An inductive load takes a current of 2.5 A; a non-inductive resistor connected in parallel takes 2.4 A, when connected across 250 V supply. The total current taken from the supply is 4.5 A. Calculate:

a)    Power absorbed by the load.

b)    Load impedance.

c)     Power factor of the load.


Given: I3 = 2.5 A; I2 = 2.4 A; I1 = 4.5 A; V = 250 V.

Non-inductive resistance, R = (V/I2) = 250/2.4 = 104.17 O.

i)                  Power absorbed by the load, P:

P = (R/2)*(I1^2 – I2^2 – I3^2)

= (104.17/2)((4.5^2)-(2.4^2)-(2.5^2)) = 429.2 W     (Ans.)

ii)                Load impedance, Z:

Z = (V/I3) = (250/2.5) = 100 O   (Ans.)

iii)             Power factor of the load, cos ? = (I1^2 – I2^2 – I3^2) /2I2I3

= [(4.5^2)-(2.4^2)-(2.5^2)]/(2*2.4*2.5) = 0.687    (Ans.)

You may also like:

Three voltmeter method for measurement of power.

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

Shri Ganeshay Namah:

// Shri Ganeshay Namah : //

shri ganeshay namah
Shri Ganeshay Namah:
Akhuratha One who has Mouse as His Charioteer
Alampata Ever Eternal Lord
Amit Incomparable Lord
Anantachidrupamayam Infinite and Consciousness Personified
Avaneesh Lord of the whole World
Avighna Remover of Obstacles
Balaganapati Beloved and Lovable Child
Bhalchandra Moon-Crested Lord
Bheema Huge and Gigantic
Bhupati Lord of the Gods
Bhuvanpati God of the Gods
Buddhinath God of Wisdom
Buddhipriya Knowledge Bestower
Buddhividhata God of Knowledge
Chaturbhuj One who has Four Arms
Devadeva Lord of All Lords
Devantakanashakarin Destroyer of Evils and Asuras
Devavrata One who accepts all Penances
Devendrashika Protector of All Gods
Dharmik One who gives Charity
Dhoomravarna Smoke-Hued Lord
Durja Invincible Lord
Dvaimatura One who has two Mothers
Ekaakshara He of the Single Syllable
Ekadanta Single-Tusked Lord
Ekadrishta Single-Tusked Lord
Eshanputra Lord Shiva’s Son
Gadadhara One who has The Mace as His Weapon
Gajakarna One who has Eyes like an Elephant
Gajanana Elephant-Faced Lord
Gajananeti Elephant-Faced Lord
Gajavakra Trunk of The Elephant
Gajavaktra One who has Mouth like an Elephant
Ganadhakshya Lord of All Ganas (Gods)
Ganadhyakshina Leader of All The Celestial Bodies
Ganapati Lord of All Ganas (Gods)
Gaurisuta The Son of Gauri (Parvati)
Gunina One who is The Master of All Virtues
Haridra One who is Golden Coloured
Heramba Mother’s Beloved Son
Kapila Yellowish-Brown Coloured
Kaveesha Master of Poets
Kirti Lord of Music
Kripalu Merciful Lord
Krishapingaksha Yellowish-Brown Eyed
Kshamakaram The Place of Forgiveness
Kshipra One who is easy to Appease
Lambakarna Large-Eared Lord
Lambodara The Huge Bellied Lord
Mahabala Enormously Strong Lord
Mahaganapati Omnipotent and Supreme Lord
Maheshwaram Lord of The Universe
Mangalamurti All Auspicious Lord
Manomay Winner of Hearts
Mrityuanjaya Conqueror of Death
Mundakarama Abode of Happiness
Muktidaya Bestower of Eternal Bliss
Musikvahana One who has Mouse as His Charioteer
Nadapratithishta One who Appreciates and Loves Music
Namasthetu Vanquisher of All Evils and Vices and Sins
Nandana Lord Shiva’s Son
Nideeshwaram Giver of Wealth and Treasures
Omkara One who has the Form Of OM
Pitambara One who has Yellow-Coloured Body
Pramoda Lord of All Abodes
Prathameshwara First Among All
Purush The Omnipotent Personality
Rakta One who has Red-Coloured Body
Rudrapriya Beloved Of Lord Shiva
Sarvadevatman Acceptor of All Celestial Offerings
Sarvasiddhanta Bestower of Skills and Wisdom
Sarvatman Protector of The Universe
Shambhavi The Son of Parvati
Shashivarnam One who has a Moon like Complexion
Shoorpakarna Large-Eared Lord
Shuban All Auspicious Lord
Shubhagunakanan One who is The Master of All Virtues
Shweta One who is as Pure as the White Colour
Siddhidhata Bestower of Success and Accomplishments
Siddhipriya Bestower of Wishes and Boons
Siddhivinayaka Bestower of Success
Skandapurvaja Elder Brother of Skand (Lord Kartik)
Sumukha Auspicious Face
Sureshwaram Lord of All Lords
Swaroop Lover of Beauty
Tarun Ageless
Uddanda Nemesis of Evils and Vices
Umaputra The Son of Goddess Uma (Parvati)
Vakratunda Curved Trunk Lord
Varaganapati Bestower of Boons
Varaprada Granter of Wishes and Boons
Varadavinayaka Bestower of Success
Veeraganapati Heroic Lord
Vidyavaridhi God of Wisdom
Vighnahara Remover of Obstacles
Vignaharta Demolisher of Obstacles
Vighnaraja Lord of All Hindrances
Vighnarajendra Lord of All Obstacles
Vighnavinashanaya Destroyer of All Obstacles and Impediments
Vigneshwara Lord of All Obstacles
Vikat Huge and Gigantic
Vinayaka Lord of All
Vishwamukha Master of The Universe
Vishwaraja King of The World
Yagnakaya Acceptor of All Sacred and Sacrificial Offerings
Yashaskaram Bestower of Fame and Fortune
Yashvasin Beloved and Ever Popular Lord
Yogadhipa The Lord of Meditation