A member of the Microsoft.SharePoint namespace, SPSite represents a collection of sites in a Web application, including a top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site ...

learn more… | top users | synonyms

3
votes
3answers
27 views

Create a Field that only accepts SharePoint groups

I need to create a SharePoint 2013 field that only accepts groups (from SP, not AD). I know I can add UserSelectionMode="PeopleOnly" to make it accept only people, but I want the opposite. Is there ...
2
votes
2answers
45 views

Problem with RunWithElevatedPrivileges and Context

I'm trying to modify two properties I have in several documents in my SharePoint library. This is the code I use to get into the library: public SPArchiveBDI(string sharepointsite, string ...
0
votes
2answers
45 views

Dispose the correct SPSite object for garbage collection

I have these lines of code: string siteUrl = "http://myTestSite"; using (SPSite siteCollectionParent = new SPSite(strUrl)) { SPWebApplication webApplication = siteCollectionParent.WebApplication; ...
0
votes
1answer
82 views

Using Get-SPSite -Filter

I seem to be having some trouble using the Filter parameter on the Get-SPSite cmdlet. Using this question for reference, I'd hoped to filter out the Site that I was getting, to later on exclude it ...
1
vote
2answers
56 views

How can you change a rootweb name, url etc?

How can I change the name on a root web? Right now it's http://dev1/sites/dog. I am trying to change it to http://dev1/sites/cat I have tried $web = get-spweb http://dev1/sites/dog $web.Name = "...
1
vote
1answer
35 views

Effect of using multiple SPSite and SPWeb objects

I want to know that what effects will cause if I open SPSite and SPWeb objects more than once in a code file (c#) I have a implementation like below, can anyone tell me that what effects will it ...
2
votes
2answers
144 views

Need comments for code within SPSecurity.RunWithElevatedPrivileges

I am investigating the below code to make sure if its quality is as per Microsoft standards. Actually Comments came from Microsoft code reviewer that we need to create new SPSite Object within the ...
1
vote
0answers
35 views

Timeout using SPsite object and U2U Caml query

We have 2 collection. 1 is test and other is production environment. In test collection, I'm writing console application which is using SPSite and SPWeb objects. But it takes nearly 40minutes to get ...
0
votes
1answer
28 views

Create a site collection in root path with PowerShell

I am trying to create a new site collection with powershell in the root path http://mysite/search/ $siteName = "Search"; $webAppUrl = "http://sharepoint"; $siteUrl = "$webAppUrl/$siteUrl";...
4
votes
1answer
53 views

Using Visual Studio, how can I reference a SharePoint 2010 site collection outside of the development machine?

I am creating a custom web service which needs to reference a specific site collection on our SharePoint 2010 farm. The web service is on a development machine not part of the farm (although ...
0
votes
1answer
78 views

Move-SPSite: Cannot find an SPSite object with ID or Url

One of my sites has grown large, and I want to move it to a new Content DB. I've created a new content db, ResearchDB, successfully added it to SharePoint (New-SPContentDatabase), and checked Get-...
0
votes
2answers
38 views

I am getting Cannot find an SPSite that contains the following…Error

I have a PowerShell script below: Add-PSSnapin Microsoft.SharePoint.PowerShell function Get-DocInventory([string]$siteUrl) { $web = Get-SPWeb "http://contoso.com/sites/Test10" ...
0
votes
1answer
13 views

is either new SPSite(string url) or new SPSite(GUID guid) better than the other? how

I have cached access to either the Url or the GUID for multiple SharePoint site collections (SPSites), and I am trying to create new references to them for permissions purposes (SPSite constructor). ...
1
vote
0answers
61 views

Programmatically created SPWebApplication's WebParts not registered as safe

I am having a frustrating issue with a programmatically created web application in which a programmatically deployed solution's web parts are not registered as safe when adding to a programmatically ...
0
votes
2answers
22 views

Ideas underpinning SPSite and SPWeb [duplicate]

Edit: I'm not sure this will help, but I'll try: I am asking "what's the whole idea with wheels?"; a list of wheel parts is not what I am after. /edit I'm aware that SPSite - despite the confusing ...
2
votes
2answers
170 views

SPSite.Exists always returns false

I am trying to determine if a site collection exists, but the SPSite.Exists method always seems to return false regardless if the site collection exists or not. Snipp: bool exists; Uri uri = new Uri(...
1
vote
0answers
37 views

Best practice for re-using the SPWeb object across code layers/services

I have several services that use the SPWeb object. These services are called to perform various functions, sometimes completely unrelated. i.e. an AuthenticationService uses SPWeb to get information ...
1
vote
1answer
62 views

Determine if object is SPSite or SPWeb

I have a simple question, how to determine with PowerShell if a SharePoint Site is a SPSite object or SPWeb? I get all Site followed by user but some are SPSite.
0
votes
1answer
346 views

The language is not supported on the server

I installed Language Packs for SharePoint Server 2010 from: https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=3411 On creating a new site collection using PowerShell with ...
1
vote
3answers
3k views

Site.OpenWeb() VS Site.RootWeb()

Just want to clarify between the two: what web variable will hold in both cases: SPWeb web = Site.OpenWeb(); SPWeb web = Site.RootWeb();
0
votes
1answer
293 views

how to get spsite title only

Right now my code gets the URL from my SPSite but I only want to get the Title var url = portalUrl.Text; if (SPSite.Exists(new Uri(url))) { using (SPSite oSiteCollection = new SPSite(url)) { ...
0
votes
1answer
120 views

Why is IsCurrentUserMemberOfGroup throwing an exception when run on SPSite.RootWeb?

Running this code in PowerShell (or even in a web context in C#) gives an unexpected behavior: Calling IsCurrentUserMemberOfGroup directly on the RootWeb object gives an exception, and worse: it ...
3
votes
1answer
521 views

Maximum length of SPSite Name and Description property values

Is there any reference to the maximum size for the Name and Description properties of a site collection?
4
votes
1answer
325 views

Setting an SPSite to read-only from Application Page

We are trying to make a site read-only from the code-behind of an application page. When executing the code-snippet from a timer job or a console application it works perfectly, but it throws an ...
0
votes
0answers
89 views

Cannot connect to my SPSite

I'm facing a strange issue. I have a console application project and added assembly Microsoft.SharePoint from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft....
1
vote
1answer
1k views

Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime

I am developing a windows service in C# and adding dll for SharePoint. I have added reference from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint....
3
votes
2answers
815 views

Get SPWeb at all the levels

I have a root site with sites at different levels(depth is unknown). How can I find all the SPWeb objects iterating till the deepest level. will the below code give me desired result ...
0
votes
1answer
525 views

Error while restoring Site Collection to the same server

I am trying to restore a site (http://server:7457) to another site (http://server:80) on the same server. I had took the backup of the first site using SharePoint Administration Central. When I ...
1
vote
2answers
7k views

What is difference between SPContext.Current.Web.URL and SPContext.Current.Site when using SPSite object?

SPSite spsite1=new SPSite(SPContext.Current.Web.URL); SPSite spsite2=SPContext.Current.Site; What is the difference and when do we decide which one to use? I feel both give us the site collection ...
0
votes
4answers
472 views

SPSite URL value

Hello I am trying to fetch a list item and want to know if this is a good practice. SPSite spsite = new SPSite(SPContext.Current.Web.Url); SPWeb spWeb = spsite.RootWeb; ...
1
vote
1answer
62 views

Can we put an SPWeb object into a SPSite object?

This is possible: using (SPSite site = new SPSite(SPContext.Current.Site.WebApplication.Sites[0].Url)) Is this possible?: using (SPSite site = new SPSite(SPContext.Current.Site.WebApplication....
0
votes
1answer
822 views

What is difference between SPSite.Url and SPSite.RootWeb.Url

What is difference between: SPSite.Url SPSite.RootWeb.Url If both are same, Which is considered to be good practice?
0
votes
2answers
562 views

What is difference between SPSite spSite = SPContext.Current.Site; and SPSite spsite = new SPSite(SPContext.Current.Web.Url)

What is difference between SPSite spSite = SPContext.Current.Site; and SPSite spsite = new SPSite(SPContext.Current.Web.Url) Which is good practice?
0
votes
2answers
333 views

Migrate SP2013 Enterprise to New Farm with SP2013 Standard with new SQL Server

I was hoping to get some advice on the best way to migrate from an Existing SharePoint 2013 Enterprise Farm, to a completely new Farm running SharePoint 2013 Standard. I will need to migrate User ...
0
votes
3answers
3k views

Error creating SPSite using powershell

I am trying to create a web application "http://Intranet" and a site collection "http://Intranet" on SharePoint 2013 foundation farm. Here is my code $sp = New-SPAuthenticationProvider $web = New-...
0
votes
3answers
2k views

What is Site, Web, Site Template and Web Template in SharePoint?

Can anyone please tell me what the difference is between Site and Web in SharePoint. Also what is Site Template and Web Template?
1
vote
1answer
148 views

Best way of retrieving a collection of SPSite in code

I have a page where the user will be entering a data in a textbox, and click submit, and it brings all site collections that url contains this data in textbox, I am currenlty doing a Linq query to ...
0
votes
1answer
378 views

The Web application at http://myWebsite.myCompany.nl could not be found

I have some custom code which is trying to get some item value from a list. First I wil try create a spsite object. But I got this error: Exception in GetConfigValue:PortalName, problem: at ...
1
vote
1answer
58 views

Error Acessing Remote SharePoint 2010 sites within same network from .NET 3.5 Windows Application

We have been working on a .NET Windows Application for doing Admin tasks and some validation in SharePoint 2010 , since the tool needs to have the functionality to do a site backup and restore I have ...
9
votes
1answer
625 views

What does SPSite.LastContentModifiedDate track?

What causes SPSite.LastContentModifiedDate to be updated with a later date? Does it track: changes to the definition of lists/fields/content types or just the content stored in them? changes to ...
2
votes
4answers
758 views

SharePoint 2013 Using SPSite in Custom WCF Content Enrichment Webservice

I have to write a content enrichment webservice which retrieves data from an specific SharePoint Site (SPSite). But my code doesn't run, if i make a new SPSite Object. Also no logging information in ...
1
vote
1answer
351 views

Best way to copy site collections

I am looking in to copying a whole SP 2013 collection to a new one. (target URL could be in the same server or farm, though unlikely) I want to mention that, this is meant to be a 'copy machine' to ...
1
vote
1answer
7k views

Is it possible to get an SPList object with just a Url?

I have a url field that contains the url of a Discussion board that I will be creating a new item for. Thing is this discussion board can be in any site or web. So far I have two ideas but would like ...
0
votes
2answers
421 views

How to get SPSite in ASP.NET Web Site Project

I'm trying to use SP 2010 site from ASP.NET Web Site Project and when I create a new instance of SPSite I get this error: The Web application at could not be found. Verify that you have typed the URL ...
0
votes
1answer
161 views

How to access a site on another machine in the same domain programmatically?

I have a site on DOMAIN\PC1 with url http://site1. I can access it by using following code (code is running on DOMAIN\PC1): using(SPSite site = new SPSite("http://site1")) { } Also there is a site ...
2
votes
2answers
2k views

Powershell Enumerate through all site collections but not include one specific site collection

I am partially not even sure how to Google this question because whatever I type never seems to bring back any relevant search results. I currently have a working script that is set to go through and ...
4
votes
3answers
1k views

SPSite.Exists returning true for a just deleted site collection

Short story - I have a process that creates some sitecollection, so to test it I keep deleting and recreating the same site over and over. The process includes a check with the istruction SPSite.Exits,...
1
vote
3answers
154 views

How to get all SPWebs using visual studio?

I want to get all webs including it's subwebs. Eg. Site web1 subweb1 subweb2 web2 How to achieve ?
2
votes
1answer
146 views

Is there any way to validate site ID without instantiating SPSite?

I need a fast way to ensure that site ID is correct. Instantiating SPSite seems to be quite expensive, so may be there are other options to do this.
0
votes
1answer
949 views

Accessing SpSite from a Thread or ThreadPool

I have a couple of question regarding developing multithreading webparts in SharePoint. First, let me explain the idea. I have a page with 5-7 different webparts. These webparts are constructed all in ...