Quantcast
Viewing all articles
Browse latest Browse all 21975

export sharepoint userlist using powershell

I'm trying to export a list of all our users, specifically the fields name, email and PictureURL'

The end goal is to get a list of email adresses for users that dont have a user image. So we can chase them up

But for now im just trying to iterate through userlist and return a list of results in .csv format

$siteUrl="http://sp2010/" $web = Get-SPWeb $siteUrl $site = $web.Site $rootWeb = $site.RootWeb $UserList = $rootWeb.Lists["User Information List"] $groups = $site.RootWeb.sitegroups $Output = foreach ($user in $UserList) {"User: " + $user.name} $rootWeb.Dispose() $web.Dispose() $site.Dispose() $Output > "C:\MembersExport.csv"

my output file just has a single line that says 'User:'



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>