none
Powershell alternative for STSADM MigrateUser

    Question

  • Can anyone help me by suggesting  Powershell alternative for STSADM MigrateUser command?

    As per my understanding the following MigrateUser command updates the user profile store for user whose AD IDs changed  

    stsadm -o migrateuser -oldlogin domain\oldid  -newlogin domain\newid  -ignoresidhistory

     

    Thanks in advance!!!

     

    Wednesday, January 18, 2012 7:06 PM

Answers

All replies

  • you can use the SPFarm.MigrateUserAccout function as illustrated in the following post

    http://blogs.msdn.com/b/sowmyancs/archive/2012/01/07/migrate-users-groups-powershell-script.aspx

    Hope this helps

     

    Serge Luca


    Serge Luca; SharePoint MVP ; blog: http://sergeluca.wordpress.com/ Devoteam Belgium. http://twitter.com/sergeluca
    • Marked as answer by Wayne Fan Friday, January 27, 2012 5:52 AM
    Wednesday, January 18, 2012 7:11 PM
  • Move-SPUser [-Identity] <SPUserPipeBind> -NewAlias <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-IgnoreSID <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
    

    See Move-SPUser reference in technet.
    Simon Rennocks | SharePoint 2010 MCITP & MCPD | Microsoft Community Contributor 2011 | Blog | LinkedIn
    • Marked as answer by Wayne Fan Friday, January 27, 2012 5:52 AM
    Wednesday, January 18, 2012 7:11 PM
  • $user = Get-SPUser domain\username -Web http://sharepoint/sites/somesite

    Move-SPUser $user -NewAlias domain\username2

    To be honest, for a mass move, the stsadm command is just easier as you don't have to identify the user on a specific site.


    http://sharepoint.nauplius.net
    • Marked as answer by Wayne Fan Friday, January 27, 2012 5:52 AM
    Wednesday, January 18, 2012 7:15 PM
    Moderator
  • For me Sync-SPUser with -SyncFromAD switch worked. From http://blog.falchionconsulting.com/index.php/2011/12/updating-sharepoint-2010-user-information/#comments

    My scenario was that User information in AD changed and even after a UPA synch, the information on my sites were still unchanged.


    Please Mark Answered if my reply solves your problem. Thanks!
    • Marked as answer by Wayne Fan Friday, January 27, 2012 5:52 AM
    Wednesday, January 18, 2012 7:15 PM
  • Make sure you're running at least the June 2011 Cumulative Update.  Prior to that CU, the UPA did not support domain migrations.
    http://sharepoint.nauplius.net
    Wednesday, January 18, 2012 7:16 PM
    Moderator