Setting trust level in Sharepoint without changing web.config - sharepoint

I want to change the trust level of a Sharepoint Web Application without having to change the web.config manually (i.e. WSS_Minimum, WSS_Custom, etc). Making manual changes to the web.config tag is highly undesirable in anything other than a one-server farm. Is there any way via stsadm or Central Admin to change this?
Third party tools or a Powershell script would be acceptable in that they would make clear that there's no native way to accomplish this.
Thanks in advance

See my answer here. There's an object model call to propagate web config modifications to every server in a farm as well as a freely available Central Admin plugin that wraps the OM in an easier to use interface.

There is a class designed for this called SPWebConfigModification that will propagate your changes to all member servers of the farm.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx
-Oisin

SPWebConfigModifications are a pain.. but this stsadm extension will make it a lot easier.

Create a CAS policy?

Related

What is the best way to create SharePoint 2010 copy?

I'm looking for a way to duplicate the content of a SharePoint 2010 server in order to work against it without taxing the main (production) server. I would need the backup server to update as needed, but I'm not looking for a failover solution. It looks like 2010 includes replication features for failover, but I can't tell if this is appropriate for my solution as well (simply not configuring the switchover feature). Can someone with SP 2010 experience tell me if this feature would work for my needs?
You could attach a restored backup of your production content database. See this MSDN documentation for more info: Attach or detach content databases (Sharepoint Server 2010).
There is also a GUI tool http://sushi.codeplex.com/ which should help you. You could backup production and restore to dev site whenever you needed to.
You could also use either stsadm.exe and the backup/restore option OR the powershell cmd backup/restore.
In addition, there is a built in interface in Central Admin to backup/restore sites. I've generally found either the command line or the SUSHI tool to be quicker and easier.
In most cases, the taxing work is on the sharepoint side, not the SQL side. You could attach another front end to the farm but reserve it for only your traffic. Otherwise you're looking at some form of backup/restore to copy everything to a 2nd duplicate farm.

Holding Page during SharePoint Upgrade?

We'll be upgrading a client's MOSS public internet site soon from a Cumulative Update to SP2 and are conscious that there will be downtime (to perform the upgrade and possibly troubleshooting!). We would like to add a holding page so that visitors still get access to key contact details and a message that the site is under maintenance.
Does anyone have any tips for doing this type of thing with SharePoint? I know of the app_offline.htm file that when dropped into the web root, will automatically prevent access to the rest of the site but wasn't sure if this was standard practice in the SharePoint world?
Any tips?
Cheers, James.
If the app_offline.htm works for you, then by all means, use it.
I think that it will the best option for you, and to the best of my knowledge SharePoint doesn't have any other means of putting itself offline.
As this is a public intranet site you are updating, presumably there is already a test environment for it that is close or the same in configuration. It is important to follow exactly the same steps for updating the test environment as you would for production. These should be documented as well and followed to the letter to reduce the likelihood of mistakes. This way you are much less likely to run into problems.
I would try app_offline.htm as you suggest (like Magnus I don't believe there is another way to take SharePoint offline). If your test environment updates with this in place you should be fine.

Have you moved MOSS SharePoint 2007 out of the C:\Inetpub\wwwroot\wss\ folder?

Is it best practice to not use C:\Inetpub\wwwroot\wss\ for SharePoint? My concern is that the configuration wizard seems to look for this C: path and it may be too complicated to not use the default path(s),
What would be the reason for using an alternate location?
You should not be changing anything in the sharepoint IIS sites through IIS Manager, except through the sharepoint Central Admin site. There are dependencies in the sharepoint configuration that are not just stored in IIS, especially around the users that are applied for app pools etc. This website does most of the things you need to do (i.e. host headers etc)
So best practice is to create a folder in the C:\Inetpub\wwwroot\wss\ that is easy to map to the web application and then leave the folder as is.
Although it is hard to find stuff in the Central Admin site, the Infrastructure Update for SharePoint helps.
Having failed miserably in the past merely trying to change machine names on a VM after Sharepoint was installed, it is hard to imagine a goal more likely to frustrate than this idea!
The only arguments I've heard for not running IIS websites out of the Inetpub directory is that it's a commonly known location for evildoers to look at when attacking a system, but if security is your concern you're far past screwing the pooch if an attacker has file system access.
We've always let the configuration wizard pick that location for us. There's a lot of aspects of the underlying configuration that rely on that location and it's never seemed worthwhile to explore changing the home directory.

How to update web.config on each WFE in a SharePoint server farm?

We have a SharePoint farm with multiple WFEs. A new application requires us to write some custom code to the web.config during deployment. What is the best way modify the the web.config file during deployment, ensuring that each WFE in the farm get updated?
I'm assuming you'll be deploying your code via a WSP; if not, using a tool like WSPBuilder is a great starting place that allows you to get rolling without forcing you to learn all of the intricate details of solution package construction.
You should leverage the SPWebConfigModification type from within a custom SPFeatureReceiver. Normally, the FeatureActivated method of the SPFeatureReceiver would be coded to write the changes out to the web.config files impacted by your activation. Those same changes would then be retracted in the FeatureDeactivating method.
The nice thing about the SPWebConfigModification type is that SharePoint takes care of determining which web.config files should be modified -- across servers and across extended web apps.
I hope this helps!
As part of your deployment, use the SPWebConfigModification class to add/remove entries from web.config. SharePoint will manage updating the WFEs for you if you use this.
A blog post entitled, Modify the web.config file in SharePoint using SPWebConfigModification, is a great summation of the gotchas involved and contains links to other helpful resources.

How to change SharePoint extended web application's web.config file

Using the SharePoint API, how can I modify an extended webapp web.config file?
I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication.
Currently, I can change the "master" webapplication web.config file, but not the extended one.
Edited
I'm using Sp 2007. I'm already using SPWebConfigModification class to modify the parent webapp. Thoses modifications are propagated to the extended webapp. I have to change ONLY the extended one. But I don't find the way to do it.
What I'm trying to achieve, is to program a little wizard that:
Shows a WebApp list so the user can select one
Extend that selected webapp to a different zone
Configure that extended zone to use Forms Authentication
Thanks
I got an answer form a blog.
In your case , you need to write a Web Application scoped feature which after you provision your site using your C# app, it is deployed to the newly-provisioned site and in the receiver of the feature you inject the required web.config settings because in that context configuration API is obtainable , but again bear the following in mind:
If you don’t use SPWebConfigModification class and either use ASP.NET 2.0 configuration API or your own mechanism , propagating changes across the farm is YOUR RESPONSIBILITY. If this happens on an standalone installation then you don;t need to be worried about this.
So it cannot be done externally. We have to do a feature in order to acheve this.
Thanks
Quick answer: look into the SPWebConfigModification class. I am assuming you're using SharePoint 2007. The best way to learn about this is to dig into open source projects:
Google code search: http://www.google.com/codesearch?q=spwebconfigmodification&hl=en&btnG=Search+Code
This project on CodePlex looks like it's one big SPWebConfigModification: http://www.codeplex.com/ajaxifymoss/Release/ProjectReleases.aspx?ReleaseId=13360

Resources