学习:Using STSADM -o migrateuser on a re-created account(转)


Reference: http://blog.krichie.com/2008/06/27/using-stsadm-o-migrateuser-on-a-re-created-account/

I see this come up quite a bit and thought I would show you how to work around the problem.  I thought I had show this on my old blog a couple of years ago, but can’t seem to find it.

Scenario

A user in your organization is deleted, and re-created using the same domain and sAMAccountName.  This may have been because of an accident, or a previous employee who left your organization and was then rehired. 

For example, my account in the NA domain with a sAMAccountName of krichie (NA\krichie).   The account was deleted and re-created with the same sAMAccountName (NA\krichie)

Because SharePoint stores SID information with the user in it’s tables, the account will no longer work until you either

1) Remove the user completely and re-add, or

2) Use the STSADM -o migrateuser command

The problem, is that if you try to use -o migrateuser such as:

STSADM -o migrateuser -oldlogin na\krichie -newlogin na\krichie -ignoresidhistory

The command will fail reporting “Cannot complete this action…Please try again”

Cause

This is because the -oldlogin and -newlogin arguments are the same.  As far as stsadm -o migrateuser is concerned, there is nothing to migrate.

Solution

The solution is to migrate the user to a temporary account and then back from the temporary account to the new account with the same name such as:

STSADM -o migrateuser -oldlogin na\krichie -newlogin na\temporaryaccount -ignoresidhistory

STSADM -o migrateuser -oldlogin na\temporaryaccount -newlogin na\krichie -ignoresidhistory

MigrateUser will then see that the accounts are different and allow the operation to be performed.  You then just run again from the temporary account to the new re-created account and your good to go.

Comments

SharePoint 迁移用户

SharePoint迁移到不同的AD中时,可能会出现相同的用户名,
但是在SharePoint中把他当成2个用户,需要通过STSADM进行进行替换:
STSADM -o migrateuser -oldlogin na\krichie -newlogin na\temporaryaccount -ignoresidhistory

STSADM -o migrateuser -oldlogin na\temporaryaccount -newlogin na\krichie -ignoresidhistory
 

Migrateuser:Stsadm 操作 (Office SharePoint Server)

将 Microsoft Office SharePoint Server 2007 中的用户帐户迁移到新的登录名和二进制 ID。如果已经存在一个新的登录名项,则会将该项标记为要进行删除以便进行迁移:将用户访问权限从一个域用户迁移到另一个域用户。
 

Migrating SharePoint Forms Based Authentication Accounts

For example:

stsadm -o migrateuser -oldlogin “aspnetsqlmembershipprovider:user″ -newlogin”nanmumembershipprovider:user″ -ignoresidhistory
Echo Liu at 4/22/2009 4:52 PM

MigrateUserAccount by Code

Use the api: SPFarm.MigrateUserAccount ,
can migrateUserAccount By Code.
 
posted @ 2009-07-24 17:03  LeimOO  阅读(488)  评论(0编辑  收藏  举报