SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am importing data into a SharePoint list. One of the columns is the user's login/name which links to their profile via their SharePoint user id.


In order to import correctly, I first need to pull out the id and login, so that I can match them to their appropriate rows, then import the data accordingly.

How can I get the logins and ids?

share|improve this question

This could work, but only for a given SPWeb:

Get-SPUser -Web http://localhost | ForEach-Object { $_.Id }
share|improve this answer
To get the name you can try $_.Name, like this: ForEach-Object{ "" + $_.Id + " " + $_.Name } – eirikb Sep 20 '12 at 5:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.