Learning: When you log on to Moss, only the system account is available, and other accounts cannot log on to the MOSS: fix those SIDS

Source: Internet
Author: User

 

Fix those SIDS

(I'm not sure why this isn't showing up under my blog, but I'm working on it !)

Thanks to my good friend Jeremy McMahan for finding the suser_sid () function for me -- my original solution was a crazy mix of linked servers and the directory services provider for oledb!

Ever migrate your SharePoint site to a totally new environment and discover that your efforts to re-create your Active Directory were all for nothing, since all the users got new SIDS? Symptoms like: the Administrator of the server can log in, but nobody else can, even though you're sure their usernames and passwords are right.

Here's a script that'll fix that up for you in a jif. open query analyzer and run it against the content database for your site, and it will update all the SIDS for your users to the SID that is reported for that user by Active Directory.

Big fat Disclaimer: Microsoft does not support any modifications to your SharePoint databases. that's not to say they won't support your SharePoint site, but if this operation breaks your server, Microsoft won't help you. i'm not responsible for the results, either, while we're on the subject of passing the buck. back up your database.

Okay, now that we 've gotten that mumbo-jumbo out of the way, here's the code.


    

 

 

Declare@ LoginVarchar(40),@ SystemidVarbinary(128)

 

DeclareCurusersCursorLocalFor

SelectTp_login,Tp_systemidFromUserinfoWhereTp_deleted=0

 

OpenCurusers

 

FetchNextFromCurusersInto@ Login,@ Systemid

 

While @ Fetch_status =0

Begin

Print 'Resetting user' +@ Login+ 'To New Sid'

Print Suser_sid(@ Login)

UpdateUserinfo

SetTp_systemid= Suser_sid(Tp_login) Where Current OfCurusers

FetchNextFromCurusersInto@ Login,@ Systemid

End

 

CloseCurusers

DeallocateCurusers

 

Go

 

ArticleFrom: http://www.sharepointblogs.com/dustin/archive/2004/09/10/756.aspx

 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.