學習:Using STSADM -o migrateuser on a re-created account)

來源:互聯網
上載者:User

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. 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.