webapplication creation modifies all other web.config automatically files
Hi All
Can anyone shed some light on this issue, as i cannot find anything related in internet.
I have this moss server where creating new web application modifies all the other website web.config files."Date modified" for all web.config becomes the same date as when i created new web app. Although it does not affect any sites but
Forms based Authentication site.
Particularly FBA site connection string gets overwritten with custom connection string (code below), which brings my fba site down. and updates <forms loginUrl="/_layouts/ExternalCollaboration/login.aspx" /> where i have specified custom login
page. What i am trying to find out is two things:
a. Where is the default conection string specified? for sharepoint to copy and replace my custom connection string with another custom connection string. This connection string it inserts is a valid local connection string to another live server, which makes
me belive that it is specified somewhere.
b. What trigers the web.config modification?
fyi - i have checked 12 hive webconfig and custom fetaure but nothing found.
<connectionStrings>
<add name="ADAMConnectionString" connectionString="LDAP://mylocaldomain.LOCAL:636/CN=Users,CN=EXTUSERS,DC=mylocaldoamin,DC=LOCAL" />
<add name="DBConnectionString" connectionString="Data Source=databasename; Database=ECTS; Integrated Security=SSPI" />
</connectionStrings>
<membership defaultProvider="ADAMUser">
<providers>
<clear />
<add name="ADAMUser" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADAMConnectionString" attributeMapUsername="userPrincipalName"
requiresQuestionAndAnswer="true" enablePasswordReset="true" attributeMapPasswordQuestion="eatmuPasswordQuestion" attributeMapPasswordAnswer="eatmuPasswordAnswer" attributeMapFailedPasswordAnswerCount="eatmuFPAC" attributeMapFailedPasswordAnswerTime="eatmuFPAT"
attributeMapFailedPasswordAnswerLockoutTime="eatmuFPALT" />
</providers>
</membership
May 11th, 2012 10:12am
Hi,
Interestingly I havent found the source yet but you shouold be able to change the behavior fopr your web app.. In the following example I am setting the login.aspx as my custom page. Alsdo, Note I dont think your talking about a connection string but a cutom
layout page
SharePoint 2010 however, offers this functionality out-of-the-box for the following application pages:
AccessDenied (/_layouts/AccessDenied.aspx) Confirmation (/_layouts/Confirmation.aspx) Error (/_layouts/Error.aspx) Login (/_layouts/Login.aspx) RequestAccess (/_layouts/ReqAcc.aspx) Signout (/_layouts/SignOut.aspx) WebDeleted (/_layouts/WebDeleted.aspx)
PowerShell Example for SP2010: Set-SPCustomLayoutsPage -Identity "_layouts/login.aspx" -RelativePath "/_layouts/MyPages/Login.aspx" -WebApplication then iisreset to flush the cache
You can also use Get-SPCustomLayoutsPage find where your custom layout pages have been mapped. I will dig a little more this eveving but ,may not have time until tomorrow into SP2007 as I have still have old legacy code around...
The SP2007 feature receiver Example for SP2007 must be WebApp Scoped Feature
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
if (properties == null) throw new ArgumentNullException("properties");
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
if (webApp != null)
{
webApp.UpdateMappedPage(SPWebApplication.SPCustomPage.Login, "/_layouts/MyPages/Login.aspx";
webApp.Update();
}
}
-Ivan
Ivan Sanders My LinkedIn Profile,
My Blog,
@iasanders.
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2012 12:53am
HI Ivan
thanks for looking into this - however thing i want to find out is why my web.config file is getting modified, what triggers this modifiaction and what decides to set this value. I have searched under C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\12\CONFIG - nothing i can find which says modify this 3 values in web.config.
1. form login page
2. membership tags
3. custom connection string.
this only happens on new webapplication creation
May 14th, 2012 7:19am


