How to export all SharePoint Site Users to Excel sheet using powershell
$urlWeb = "http://sp.com/sites/test"
Get-SPUser -Web $urlWeb | select DisplayName, Email, UserLogin, @{name="Exlicit given roles";expression={$_.Roles}}, @{name="Roles given via groups";expression={$_.Groups | %{$_.Roles}}},@{Name='Groups';Expression={$_.Groups -join '|'}} | Export-Csv "D:\macs.csv"
$urlWeb = "http://sp.com/sites/test"
Get-SPUser -Web $urlWeb | select DisplayName, Email, UserLogin, @{name="Exlicit given roles";expression={$_.Roles}}, @{name="Roles given via groups";expression={$_.Groups | %{$_.Roles}}},@{Name='Groups';Expression={$_.Groups -join '|'}} | Export-Csv "D:\macs.csv"
No comments:
Post a Comment