SharePoint Online: PowerShell EnsureUser Method

What is “EnsureUser” method in SharePoint Online? As its name suggests, ensure user method in SharePoint Online checks if the given user account is valid and then adds the user object to the “User Information List”. You may also use this method to obtain the User object from the given user name….

Read more

SharePoint Online: Export User Information List using PowerShell

Requirement: Export User Information List in SharePoint Online User Information List in SharePoint Online stores information about a user by having some metadata set up for the user such as User Picture, Email, DisplayName, LoginName etc. When we grant permissions to a user, they are added automatically to the hidden User Information…

Read more

SharePoint Online: PowerShell to Remove User from All Sites

Requirement: Remove User from All Sites in SharePoint Online PowerShell to Remove a User from All SharePoint Online Site Collections: The following PowerShell script will remove the provided login account from all site collections of your SharePoint Online. Please note, you must be a site collection administrator for all site collections before…

Read more

SharePoint Online: Remove User from Subsite Permission using PowerShell

Requirement: Remove user from a SharePoint Online subsite How to remove a User from SharePoint Online Subsite? To remove a user from SharePoint Online subsite, Remove user from all groups of the site Remove user from direct permissions of the site (if any) But the problem is: We’ve to check each group…

Read more

SharePoint Online: Remove User or Group from List Permissions using PowerShell

Requirement: Remove user or group from list permissions in SharePoint Online using PowerShell How to Remove User Permissions from a List in SharePoint Online? To remove a user or group from SharePoint Online list permissions, follow these steps: Navigate to your SharePoint Online list or library.  Click on Settings gear >> Select…

Read more

SharePoint Online: Delete User from User Information List

Problem: Deleted user accounts still appears in SharePoint Online People Picker! Need to remove user from user information list! Root Cause: When a SharePoint Online user browses to a site, SharePoint creates an entry in “User Information List” to cache the user information. SharePoint syncs this list from the user profile when…

Read more

SharePoint Online: Find and Delete Orphaned Users using PowerShell

What is “Orphaned Users” in SharePoint Online? In short, orphaned users are those who deleted from the authentication provider (such as removed from Active Directory when the user leaves the organization), and still continue to exist in SharePoint online sites! Scanning each user in the SharePoint Online site collection for orphaned users…

Read more

How to Check If a SharePoint User is a Member of an Active Directory Group using PowerShell?

Requirement: Check If SharePoint User is Member of a Active Directory Group using PowerShell Solution: Although we can check if a particular user account is member of a AD security group using AD PowerShell cmdlets such as Get-ADGroupMember Here is the native method to find if a particular user account is a…

Read more

SharePoint Online: Site Users and Groups Report using PowerShell

Requirement: Generate a report with all site groups and members of each group of a SharePoint online site collection. Prerequisites: Make sure you have SharePoint Online Management Shell installed! Get all Site Groups and Members of Each group: We can view users and groups in SharePoint Online using PowerShell: To get all…

Read more