SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 have a backup of a 2007 site which has been upgraded and added as the root site collection in a new web application. I am currently migrating content from this site collection to another site collection within the same web application (separate content databases).

I need to migrate the Users list (/_catalogs/users/simple.aspx) to the new site. Is there an easy way of migrating these users (such as using the OOB Migration API), or something as simple as iterating over each user, and running an EnsureUser on them in the new site?

share|improve this question
Did the user permissions not come over when you moved the site collections, etc.? – John Chapman Sep 13 '11 at 21:31
Here's the scenario: Restore a 2007 content DB, run the upgrade, and import it into a temporary site collection. At this point, I have a successful upgrade including all users. Now what I need to do (while migrating other things such as other libraries), is migrate the user accounts along with it. – Tim Gabrhel Sep 14 '11 at 13:41
up vote 1 down vote accepted

Here's a PowerShell Script that should do it. You need to supply the source and destination URLs and a group name to put the users into, at least temporarily.

$spWebDestination = Get-SpWeb -Identity http://destination.local
$spWebSource = Get-SpWeb -Identity http://source.local

$users = $spWebSource.SiteUsers
$destinationGroup = $spWebDestination.Groups["Temporary Group"]

"Source Group count = " + $users.Count 
"Destination Group count = " + $destinationGroup.Users.Count

foreach($user in $users)
    "Adding User " + $user.Name + " to " + $spWebDestination.Url

"New Destination Group count = " + $destinationGroup.Users.Count
share|improve this answer
Interesting concept. So by adding these users into the temporary group, does this add them to the hidden users list? As if they have logged in? I can't fully explain the requirement for needing them. It's just the requirement I was given for a separate app to work. – Tim Gabrhel Sep 14 '11 at 13:42
@tim Yes. Adding the users to the group will add them to the site collection's User Information List. – Tom Resing Sep 14 '11 at 23:38

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.