Thursday, September 3, 2015

Export All users to excel sheet SharePoint 2010/2013

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"

No comments:

Post a Comment