I would like to export the User Information List to a file including the ID of each user. It doesn't matter if the solution is in C#/PowerShell/SharePoint UI.
- Go to "Site Settings -> Users and Permissions -> People and groups"
- Click on the "Settings" menu and "List Settings"
- Scroll to the bottom of the page and click on the view that you want to export.
- Copy the url and in particular the List and View IDs
Go to the following url "http://[sitename]/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[LISTID]&View=[VIEWID]&CacheControl=1" replacing sitename, listid, and viewid with your own information.
When opening this in the browser you will get a save to excel option and from there you just have to open the file.