Hot answers tagged site-collection
5
What you're looking for is the host named site collection, which enables you to assign a unique DNS name to site collections. Or alternatively create an AAM for existing Site collection to achieve it. For example, you can address them as http://hr.mycompany.com or http://sales.mycompany.com.
The sample PowerShell code creates a new web application listing ...
5
If you want an event receiver on anything, then it's best to attach it to the content type Item (0x01)
Example: CharlieDigital: Programmatically Adding an Event Receiver to a Content Type
4
You can use SPContext.Current.Site.HostName property to get the host name?
Normally you can use SPContext.Current.Site.Url to return the Url of the root website in the site collection for the current web request. If you want the context of the current web site then use SPContext.Current.Web.Url.
4
Here is LINQ code that finds a Web Part with a title:
string _webPartTitle = "mywebpart";
//Retrive the webpart with some title
IList<Microsoft.SharePoint.WebPartPages.WebPart> _listFormWebParts = (from _wp in manager.WebParts.Cast<Microsoft.SharePoint.WebPartPages.WebPart>()
...
4
In my experience if you update the quota template it does not get applied to the sites that already use it.
Through Central Administration apply another quota template to the site then reapply the previous one.
If you have 100s or 1000s of sites to update you can use the following PowerShell.
Hence, If you want to update the same template just set ...
4
The text is due to confusion SharePoint creates by having three different groups which when you create a site collection start out having the same persons, but are in fact different.
The three groups are:
Site Collection Owners
Are controlled via `Central Administration | Application Management | Change site collection administrators'
Receive email about ...
4
Try this for the first link as it is intended to address exactly what you are seeing, though certain controls do not expand the value.
<CustomAction Id="script1" Location="ScriptLink" ScriptSrc="~SiteCollection/Style%20Library/mySolution/custom1.js" />
As to whether it should be in _layouts or Style Library is a debate that has raged since the ...
4
In one web application, can we create multiple root site collections ?
No, only one 'root' can exist, if you mean at the root of the URL i.e. http://domain.com/. You can create many more at http://domain.com/path/site1, http://domain.com/path/site2, etc. I just wanted to clarify the use of the word 'root'
3
For a single site (SPWeb) try using the content migration APIs. http://msdn.microsoft.com/en-us/library/ms453426.aspx
SPExportObject exportObject = new SPExportObject();
and i've been successful with these settings:
SPExportSettings settings = new SPExportSettings();
settings.FileCompression = false;
...
3
Depends on what you mean by sharing, they will be sharing the same website in IIS, the same web.config, the same content database by default, the same web application settings in Central Admin etc etc.
You can configure site collections to be under different host headers if you wish. What are your requirements? Would you prefer each customer to be accessing ...
3
You can use ECMAScript to achieve it.
var clientContext = new SP.ClientContext();
this.oWebsite = clientContext.get_site.get_rootWeb(); //always return the root web of the site collection
See some examples here.
3
If you're talking about using the Object Model, then I'd recommend SPSiteDataQuery.
It has many options for filtering the results, including by list template (e.g. document library).
3
Your scope for feature is at "Web Application" level feature and therefore be visible at
Central Administration -> Application Management -> Manage Web Application
Features
See technet
Edited
You can activate Web Application Feature by giving it's url.
stsadm -o activatefeature -id GUIDID -url https://abc303.development.com/
If you're facing ...
3
Welcome to SharePoint! Site collections don't reside on the file system at all. SharePoint magically translates the URLs and pulls everything you see from the database (some exceptions). The site collections web application is in inetpub\wwwroot\wss\virtualdirectories, but its site collections are in the database.
Is there something specific you're looking ...
3
Object cache:
What Object cache does is stores metadata about SharePoint Server objects (like SPWeb, SPSite, SPList, etc.) on the WFEs. When a page is rendered, if there is data that needs to be retrieved through these objects, the SQL Server will not be hit. Features of SharePoint that uses Object cache are publishing, content query web part, navigation, ...
3
As far as I know or according to my experience you should be creating Site Collections for departments and let each department have there own content database as a best practice.
Web applications should be created on the basis of mode of authentication.
I would recommend you to go through these topology diagrams provided by Microsoft to understand the ...
3
If your web application is in Claims mode (uses Claims based authentication, CBA), you need to grant permission for username that is in claims format, like i:0#.w|dev\administrator. More info here.
3
If you want to have a specific user be able to delete users posts then you will need to give them Manage Social Data permissions on your User Profile Service application.
Go to Service Applications - highlight the user profile service and click Administrators from the ribbon. Add a user account and select Manage Social Data from the permissions list.
The ...
2
As Per said, you can attach the following code to add the Event receivers to all the lists in a Site Collection:
All you need to do it to add this code in a Feature Receiver's class file. Note: I did it only for ItemAdding event but you can add other methods as per your likings.
public class Feature1EventReceiver : SPFeatureReceiver
{
// ...
2
In my opinion i cannot recommend to add the event receiver to the system content type because it will effect all content types below the system content type.
This might lead to unwanted problems an conflicts when the event receiver is fired.
What is the reason for adding a event receiver to every list in?
2
When you say "host header," I assume you are referring to the web application to which your site collections belong. With that in mind, you can use the SPWebApplication's AlternateUrls collection to get the host header(s) associated with that web application.
Since it is possible to have multiple URLs associated with a single web application, you would need ...
2
Should be something like:
# get the site collection
$s = get-spsite http://siteurl
# loop through all site in the site collection,
# then through all lists / libraries in that site (filtering out everything but actual doc libs
# (The catalog filter excludes all sharepoint libs like the masterpage catalog etc.
// for each list, add a folder called test ...
2
Finally got this resolved, the issue was with spacing between parameters in setting the peoplepicker-searchadforests property.
I previously was using this:
stsadm -o setproperty -pn peoplepicker-searchadforests -pv "domain:domain.local, domain\username, password" -url http://spserver
I should have been using this:
stsadm -o setproperty -pn ...
2
I just ran into the same problem and I figured out that you can pass the entire URL into the constructor of SPSite and it will determine which portion of the url is the site collection. Here is my code snippet I used in a method where I am trying to seperate the string into the site collection url and the relative site path.
try
{
//these local ...
2
SharePoint has several organizational levels, from high to low:
Farm
WebApplication
Site Collection
Web
List
Item
Each level can contain multiple items of the lower 'levels'. Thus a farm can contain multiple WebApplications, which can contain multiple site collections, which can contain multiple webs (subsites), which can contain multiple lists (and ...
2
Exporting a site should grab all the subsites as well. I just did that this week by exporting an entire site collection and importing it as a subsite within an existing site collection. Every subsite in the source site made it to the destination site.
I use:
stsadm -o export -url http://domain/sites/site -filename c:\temp\site.dat -nofilecompression ...
2
The answer depends on what you mean by having a site collection within another site collection.
The main purpose of site collections are they are completely separate, which be definition means that one cannot be inside another.
BUT thats from SharePoints point of view. You can set up managed paths such that you can create site collections which from an ...
2
I'm sure there's even a more elegant way than this, but this should work:
string siteUrl = "http://yoursiteurl";
using (SPSite site = new SPSite(siteUrl))
using (SPWeb web = site.OpenWeb())
{
foreach (SPWebTemplate template in site.GetCustomWebTemplates(uint.Parse("1033")))// or GetWebTemplates
...
2
The scalable solution to this is to use search:
Create a feature to activate on all sites/rootsites depending on what you need to show
Create a Content Type
In the feature create a hidden list with at single item of that content type having the title equal to the Sites title
Change the view page of the item to go to the front page of the site
In your web ...
2
Reason for restore failure:
You need to understand the fact that whenever you try to restore a site collection backup to the same content database from which the site backup was taken , there will be a GUID conflict. GUID for a site collection is unique and it gets stored along with the site collection backup.
Your content database has a table called ...
Only top voted, non community-wiki answers of a minimum length are eligible


