Hot answers tagged

24

If all you want is a list of all site collections in the farm, all you have to do is open a PowerShell window, load the SharePoint snapin if you haven't (Add-PSSnapin Microsoft.SharePoint.PowerShell), and type Get-SPSite. If you want to return the list of site collections for a specific web application, the easiest way is to just pipe it as ...


22

I would like to take the opportunity to pimp a few of the posts on my own blog: Site Topology Planning Part 1 Site Topology Planning Part 2 Environments can vary quite a bit in the number of site collections they will have or how deep the site hierarchies will go. The amount of content in those site collections also can very. I once had a sub-site that ...


22

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 ...


16

SPContentDatabase.ForceDeleteSite http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spcontentdatabase.forcedeletesite.aspx use this method to force a delete: SPWebApplication spWebApplication = SPWebApplication.Lookup(new Uri("http://mywebapplication")); // insert the webapplication ...


14

My response echo's a little of what Mike said... a lot of site collections stay pretty small, in which case it is much more efficient to keep them in a single content database so that there's not as much overhead (more about the number of objects in the instance than a performance perspective) in SQL Server associated with them from a database perspective. ...


13

I think that you could look at the managed paths Open Sharepoint Central Administration -> Application Managment -> Manage web applications Select your web application Click Managed Paths button on the ribbon You will see that there are at least two path: Root (Explicit inclusion) sites (Wildcard inclusion) Explicit inclusion means that you can ...


13

or simply: $site = Get-SPSite http://YourSharePointSite $site.AllWebs.Count


11

// root site – eg. Web App url string rootSiteCollectionURL = SPContext.Current.Web.Site.WebApplication.Sites[0].Url; // site collection url string SiteCollectionURL = SPContext.Current.Web.Site.Url;


11

The Publishing Features need to be active on the site collection for the web part to appear. It can be activated from the Site Settings, Site collection features screen.


9

For now, SharePoint 2010 does not support event for site collection adding or added.So it is not possible to do it programmatically Yes, You can plugin your feature to the site definition used for the site collection by "Feature Stapling". You can define a feature at scope of Web application. It will automatically activate the stapled feature(which is your ...


9

Can't test it myself but it wouldbe something like this: ######################## Start Variables ######################## $LoginName = "domain\login" $siteURL = "http://SharePointSiteURL" #URL to any site in the web application. ######################## End Variables ######################## Clear-Host $siteCount = 0 ...


9

How to retrieve sub webs under root web The following REST endpoint https://contoso.sharepoint.com/_api/site/rootWeb/webinfos will return the collection of sub webs (WebInfo objects) under root web How to retrieve sub webs under relative web Assume the following site structure: -- Root | -- Community | -- Feedback Then the ...


8

You can find a great article that explains the cross-domain / cross-site collection issues and how to resolve them on the MSDN: Solving cross-domain problems in Apps In the link above the following explanation can be found: Cross-site collection calls A different problem that is often lumped into the same cross-domain category is issuing calls to ...


8

you should find "SharePoint Server Publishing Infrastructure" under "Site settings" > "Site Collection Administration" > "Site collection features" you wont find it under site feature or you can access it through this link : https://{sharepoint server}/_layouts/15/ManageFeatures.aspx?Scope=Site


8

You're within the limitations of SharePoint (http://technet.microsoft.com/en-us/library/cc262787.aspx) in either scenario, which is good. Some of my thoughts As far as performance, I don't think you'll see much in way of improvement going from one DB to multiple DBs, unless you can move the DB files to different disk arrays. 100GB is a reasonable size for ...


8

Probably it occurs since you are using App-only policy type for authorization . According to App authorization policy types in SharePoint 2013: App-only policy—When the app-only policy is used, SharePoint checks only the permissions of the app principal. Authorization check succeeds only if the current app has sufficient permissions to perform the ...


8

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 ...


8

Go to "Site Settings -> Users and Permissions -> People and groups" Click on the "Settings" menu and "List Settings" Scroll to the bottom of the page and click on the view that you want to export. Copy the url and in particular the List and View IDs ...


8

Get-SPWebApplication xxx | Get-SPSite -Limit ALL | % {Enable-SPFeature "xxx" -Url $_.Url}


7

There should be a powershell equivalent of stsadm.exe -o enumsites -url https://sp.root.com > "U:\XML\siteowners.xml" which is what I use to generate XML for import into Excel to view all top level site collections, the owners, the content db it lives in and the size/quota information.


7

Yes, it's possible. The (probably) easiest way is to use feature stapling. Then you can say that all new instances of e.g. STS#0 (Team site), should activate this feature. <FeatureSiteTemplateAssociation Id="b8f334a0-1ffe-420d-b6e2-54a9faa6ba95" TemplateName="STS#0" />


7

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, ...


7

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 ...


7

First, you can change the O365 landing page, but you can't specify a URL for the new landing page, it's a dropdown menu. See https://blogs.office.com/2014/09/18/new-office-365-home-page-fast-access-services/ for details. Second, this setting is a per-user one. An admin cannot change this setting for all or specific users at this time. As it's said in ...


6

$site = Get-SPSite http://intranet.sharepoint.com/ $site.RootWeb.Author where SPWeb.Author property gets a user object that represents the user who created the website


6

CSOM Using the ClientContext, get your Site object and check its URL SPContext.Current.Site.ServerRelativeUrl : if == "/" JSOM For that you can use the _spPageContextInfo variable. To check if user is in root site collection vs any other site collection, check this variable : _spPageContextInfo.siteServerRelativeUrl : if == "/", then is the absolute ...


6

From a technical point they're exactly the same. The only difference is the way users think of site collections beneath each of them. So it's common to use "/teams/" for site collections for individual teams and "/sites/" for everything else (in SharePoint Online, On-Premises often create their own) "/sites/" and "/teams/" is what is called managed paths in ...


6

There are a couple of things you can try... such as 1. Get-SPDeletedSite & Remove-SPDeletedSite You may already have restored this site before. In that process you also deleted the site first (automatically), which you can find running the command... >Get-SPDeletedSite You'll see the site (or sites) listed, like this: WebApplicationId : ...


6

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


6

Using only the Client Object Model you cannot access another site collection. You can however connect to the web services directly using a variety of methods/libraries such as jQuery. When crossing the site collection boundary, I'll mix and match the two approaches as needed.



Only top voted, non community-wiki answers of a minimum length are eligible