Introduction
In this blog, you will learn how to export all site users from SharePoint on-premises to CSV files using PowerShell.
Steps Involved.
Perform the following steps to run the PowerShell script to export all site users from SharePoint on-premises to CSV files.
- Unzip GetAllSiteUsers folder.
- Open the InputSites.csv file and update the SharePoint site URLs.
- Save InputSites.csv file.
- Open PowerShell and navigate to the GetAllSiteUsers folder.
- Run the following command. A credentials pop-up will open, enter the credentials and click OK.
.\ GetAllSiteUsers.ps1
Result
UserCount.csv and UserDetails.csv files are created in the same directory.
UserCount.csv
![User Count-]()
UserDetails.csv
![User Details-]()
Summary
This blog describes how to export all site users from SharePoint on-premises to CSV file using PowerShell.