Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
PowerShell Script To Retrieve The List Of All Site Collection Admins
WhatsApp
Gowtham Rajamanickam
8y
15.6
k
0
0
25
Blog
Steps
Open your SharePoint Management Shell.
Copy the code given below and paste it there.
Run the code given below to delete the SharePoint search component.
Code
$siteUrl = Read-Host
"https://gowtham.sharepoint.com/tutorials"
$rootSite = New-Object Microsoft.SharePoint.SPSite($siteUrl)
$spWebApp = $rootSite.WebApplication
foreach
($site
in
$spWebApp.Sites)
{
foreach
($siteAdmin
in
$site.RootWeb.SiteAdministrators)
{
Write-Host
"$($siteAdmin.ParentWeb.Url) - $($siteAdmin.DisplayName)"
}
$site.Dispose()
}
Thanks for reading my blog.
PowerShell
SharePoint
Up Next
How To Get All Site Collection Administrators From SharePoint Online Site Collections Using PnP PowerShell
Ebook Download
View all
Getting Started with SharePoint Framework Development using TypeScript, PnP JS, and React JS
Read by 4.9k people
Download Now!
Learn
View all
Membership not found