海南高端网站建设,网站域名有哪些,windows永久禁止更新,31省新增最新消息在 WSS 的数据库中#xff0c;UserInfo表的 tp_SystemId 记录的是用户登录验证时需要用到的数据#xff0c;是此用户在 AD( Active Directory ) 中的 SID( Security ID )。此字段的数据很重要#xff0c;不小心改动的话#xff0c;此用户将不能登录 WSS。
这里介绍一下如何…在 WSS 的数据库中UserInfo表的 tp_SystemId 记录的是用户登录验证时需要用到的数据是此用户在 AD( Active Directory ) 中的 SID( Security ID )。此字段的数据很重要不小心改动的话此用户将不能登录 WSS。
这里介绍一下如何修复 tp_SystemID 字段。 假设不能登录的用户叫 nt_user( UserInfo表中的 tp_Login 字段的值应该为 Domain\nt_user )。
在 AD 中找到此用户 string stPath LDAP:// System.Environment.UserDomainName; string stFilter ((sAMAccountnament_user)(objectclassuser)); DirectoryEntry userEntry null; DirectoryEntry dirEntry new DirectoryEntry( stPath ); // Create a DirectorySearcher object DirectorySearcher searcher new DirectorySearcher( dirEntry ); searcher.SearchScope SearchScope.Subtree; searcher.Filter stFilter; searcher.PropertiesToLoad.Add( objectSID ); // Analyse the results SearchResultCollection results searcher.FindAll(); Console.WriteLine( Search result count: {0}, results.Count ); if( results.Count0 ) { userEntry results[0].GetDirectoryEntry(); } else { // Can not find the user. } 获取此用户的 SID 值 用户的 SID 值可以用 objectSID 属性获取。 byte [] sid userEntry.Properties[objectSID].Value as byte[]; string stSID BytesToHexString( sid ); public static string BytesToHexString( byte [] bytes ) { System.Text.StringBuilder hexString new System.Text.StringBuilder(); for( int counter0; counterbytes.Length; counter ) hexString.AppendFormat( {0:x2}, bytes[counter] ); } 更新 UserInfo 表 打开查询分析器或自己写程序可以直接更新 WSS 数据库表 UserInfo 的 tp_SystemID 字段的值。在浏览器中再次访问 WSS 网站用户就可以成功登录了