When a Sharepoint site set is migrated from Domain A to Domain B, user permissions must also be migrated along with the site set (only domain names change ).
Because the website set user permissions are complex, you need to change the domain user for Migration (you do not need to reconfigure permissions ).
Both powershell and stsadm provide corresponding methods. to process data in batches, I use stsadm to migrate users.CodeUsage
Idea: traverse and read the username in the TXT file to migrate each username.
@ Echo offsetlocal enabledelayedexpansionSetF = % ~Dp0cd c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \14\ BinFor/F % IIn(% F % \ test.txt)Do(SetL = contoso \ %ISetN = HSH \ %Istsadm-O migrateuser-oldlogin! L! -Newlogin! N! -Ignoresidhistoryecho! L!) Pause
One user name is stored in each line in the test.txt text.
Setlocal enabledelayedexpansion is used to use variables in the for statement. For more information, see Google.
CDC: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \14\ BinDirectory (SharePoint directory)
Stsadm-O migrateuser-oldlogin! L! -Newlogin! N! -Ignoresidhistory is the key migration statement.
Save as a bat file and double-click it to complete user migration