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} }

1 Answer 1

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 and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.