Welcome to an article on how to get all users in a SharePoint 2010/13/16 farm using PowerShell Script. This script is going to run and loop in all the web applications and site collections within them and get individual and group users.

This script will help save us developers a lot of time in getting all the users from an individual or group. So, here is the script.

  • Copy the code below to a .ps1 file.
  • Run the .ps1 file on the SharePoint PowerShell modules.
  • You don’t need to do any update on the script.



Once you initiate the script, it will run through all site collections in all the webs and populate the date and save it in on the same location you are running it from, in a .csv or .txt format.

Just run this script and you will get all the users on the farm.