Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

FARMURL/userdisp.aspx?ID=56

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
add comment

1 Answer 1

This could work, but only for a given SPWeb:

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

Your Answer

 
discard

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.