Create a .ps1 script and run this in the sharepoint management console
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
foreach ($websvc in $websvcs) {
write-output "Web Applications" >> sitelist.txt
write-output "" >> sitelist.txt
foreach ($webapp in $websvc.WebApplications) {
write-output "Webapp Name -->"$webapp.Name >> sitelist.txt
write-output "" >> sitelist.txt
write-output "Site Collections" >> sitelist.txt
write-output "" >> sitelist.txt
foreach ($site in $webapp.Sites) {
write-output "Site URL --> -->" $site.URL >> sitelist.txt
write-output "" >> sitelist.txt
write-output "Websites" >> sitelist.txt
write-output "" >> sitelist.txt
foreach ($web in $site.AllWebs) {
write-output "Web URL --> --> -->" $web.URL >> sitelist.txt
write-output "" >> sitelist.txt
write-output "Lists" >> sitelist.txt
write-output "" >> sitelist.txt
foreach ($list in $web.Lists) {
write-output "List Title --> --> --> -->" $list.Title >> sitelist.txt
write-output "" >> sitelist.txt
}
foreach ($group in $web.Groups) {
write-output "Group Name --> --> --> -->" $group.Name >> sitelist.txt
write-output "">> sitelist.txt
foreach ($user in $group.Users) {
write-output "User Name --> --> --> -->" $user.Name >> sitelist.txt
write-output "" >> sitelist.txt
}
}
}
}
}
}
- Blogger Comment
Subscribe to:
Post Comments
(
Atom
)
Category
- Active Directory ( 8 )
- App Packaging ( 6 )
- BitLocker ( 9 )
- CrashPlan ( 7 )
- DNS ( 1 )
- DocLink ( 2 )
- Excel ( 3 )
- Exchange ( 7 )
- Group Policy ( 2 )
- Javascript ( 1 )
- M365 ( 5 )
- OneDrive ( 1 )
- OneNote ( 1 )
- Power Apps ( 1 )
- Power Automate ( 1 )
- Power BI ( 11 )
- PowerShell ( 54 )
- SCCM ( 28 )
- SCCM Device Collections ( 12 )
- SCCM Reports ( 12 )
- SCCM User Collection ( 2 )
- SCSM ( 4 )
- SharePoint ( 52 )
- SharePoint Design ( 20 )
- Skype for Business ( 1 )
- SQL Server ( 3 )
- SSL Certificates ( 3 )
- Teams ( 6 )
- Windows 10 ( 3 )
- Windows 7 ( 4 )
- Windows Server ( 5 )
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.