0

I am using this code but I would like to view in a table and export as a CSV but all my attempts have failed. Where does the code go?

$siteUrl = "URL" 
$site = Get-SPSite $siteUrl
$site.RootWeb.SiteAdministrators
$groups = $site.RootWeb.sitegroups
foreach ($grp in $groups) {"Group: " + $grp.name; foreach ($user in $grp.users) {"  User: " + $user.name} }
0

What about trying this?

SPGroupCollection $groups = $site.SiteGroups;

instead of

$groups = $site.RootWeb.sitegroups 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.