Regarding problem in CreateUserProfile method in Load Balance Environment
Hello All, I am facing a very weird problem. Not sure whether it is because of code or some environment settings. Actually I have a load balance servers for Moss (Extranet portal (Moss1 and Moss2)) & Domain Controllers (dc1 & dc2). We are creating users and their profiles in the central Admin (User Profiles and Properties) through code. When I explicitly run my code from being on moss1 machine it works fine for me but when I try executing the same code from moss2, at the time of creation of user profile it is giving me following exception: Encountered exception at(Method is SetUserProfile):Microsoft.Office.Server ErrorMessage is:No mapping between account names and security IDs was done And InnerException is: And Stack Trace is: at Microsoft.Office.Server.Utilities.Win32.AdvApi.LookupAc countName(String lpSystemName, String lpAccountName, IntPtr Sid, Int32& cbSid, S tringBuilder ReferencedDomainName, Int32& cchReferencedDomainName, SID_NAME_USE& peUse) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.GetSidFromAccount(S tring strAccountName, SID_NAME_USE[] IntendedAccountType, SID_NAME_USE& sidUse) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.GetSidFromAccount(S tring strAccountName) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.GetSidFromAccount(S tring strAccountName, Int32 nMaxLengh) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.GetSidFromAccount(S RPSite objSite, String strAccountName, Boolean isWindowsAccount) at Microsoft.Office.Server.UserProfiles.UserProfile..ctor(UserProfileManager objManager, String strAccountName, String strPreferredName) at Microsoft.Office.Server.UserProfiles.UserProfileManager.CreateUserProfile( String strAccountName, String strPreferredName) at Microsoft.Office.Server.UserProfiles.UserProfileManager.CreateUserProfile( String strAccountName) at SetUserProfile.Program.<>c__DisplayClass2.<SetUserProfile>b__0() at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivile ges>b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunEleva ted secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback sec ureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevate d secureCode) at SetUserProfile.Program.SetUserProfile(UserProfile newUserProfile) ******************************************************************* I did google for this problem and tried to find out how CreateUserProfile method works and found that internally there is a method LookupAccountName which actually tries to find the SID of user first in the list of available SIDs and then in local computer, then Primary Domain and then in all the trusted domains. I am not sure internally what is causing the problem but I think there may be some problem in settings of load balanced servers. Please provide me your inputs on this. Rakesh Narayan Lal
February 10th, 2009 8:41pm

mark.more, more, more...
Free Windows Admin Tool Kit Click here and download it now
January 11th, 2011 9:39pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics