$site = Get-SPSite "http://yoursite"
foreach ($web in $site.AllWebs) {
$web | Select-Object -Property Title,Url,WebTemplate
}
$site.Dispose()
foreach ($web in $site.AllWebs) {
$web | Select-Object -Property Title,Url,WebTemplate
}
$site.Dispose()
$site = Get-SPSite <Provide Site Collection URL here>
$web = $site.OpenWeb()
$groups = $web.sitegroups
foreach
($grp
in
$groups) {
"Group: "
+ $grp.name;
$groupName = $grp.name
write-host
"Group: "
$groupName -foregroundcolor green
foreach
($user
in
$grp.users) {
"User: "
+ $user.name
write-host
"User "
$user.UserLogin -foregroundcolor red
}
}
GetUsers.ps1
This will show output on screen.
GetUsers.ps1 | Out-File C:\Output.csv
This will generate output as csv file. "C:\Output.csv" is the file name and location where generated csv file is saved. Please change as per your requirement.