SPWeb is a single website in SharePoint residing in a Site Collection (SPSite).

learn more… | top users | synonyms

1
vote
2answers
2k views

Import-SPWeb error: “The file xxx.cmp does not exist.”

I have a strange issue with Export-SPWeb and Import-SPWeb for SharePoint 2013. I want to export one of my sites, so I type this command: Export-SPWeb https://test.mywebsite.com/site -Path "export....
0
votes
0answers
21 views

MOSS 2007 : web.GetListItem(remoteUrl) - Value does not fall within the expected range

Environment : SharePoint 2007 , Content databases for this environment were migrated from original hardware. Case: "Value does not fall within the expected range." exception on calling ...
5
votes
4answers
11k views

How can I get a reference to a specifc SPWeb object in a custom timer job?

I have a custom timer job that imports data from an external source into a specific list on a specific Web in my SharePoint 2010 installation. That is the job is only relevant to one list on one web. ...
4
votes
2answers
8k views

Using SPContext.Current to get public URL of the current zone

I have a single content Web application in the Default zone of my MOSS 2007 farm, which I then extended to the Extranet zone. The default zone web application uses Windows authentication and standard ...
0
votes
1answer
60 views

Import-SPWeb Into Host Named Site Collection

I have made a backup of a SharePoint Site using Export-SPWeb. I have also added a new Host Named Site Collection and I would like to Import the Site into this newly created Host Named Site Collection. ...
2
votes
1answer
2k views

What is the SPWeb.Name property for?

I'm wondering what use does the SPWeb.Name property have. Is it displayed anywhere?
0
votes
0answers
16 views

Upload static WebSite to RootFolder of a Site

I've recently noticed, that it is possible to host static web sites inside a sites (SPWebs) root folder, by uploading it using WebDAV. It seems to be working as expected (regarding permission checks, ...
1
vote
2answers
39 views

SPWeb.Exists returns true for web don't exists

Below snippet returns true for invalid web URL: using (SPSite site = new SPSite(url)) { using (SPWeb web = site.OpenWeb()) { return web.Exists; } } Web was created and deleted ...
2
votes
2answers
735 views

How to get specific sub sites Using Get-SPWeb object

In the code below i only want to get following 3 specific subsites using Get-SPWeb Object. which filter command is most appropriate to target only these 3 sites 1. http://myCo.root.site/sites/News/...
1
vote
2answers
60 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
37 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
56 views

Dispose should not be called on this object. // SPDisposeCheck comment

In the code below, within using directive, for rootweb, Dispose(); method will be called implicitly, is that correct? Or should I need a using directive for this: SPWeb rootweb = site.RootWeb since I ...
1
vote
0answers
39 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 ...
1
vote
1answer
41 views

Detecting change in users/groups on web

I want to execute some code when the users/groups with access to a web changes (addition and removal of users/groups). What are my options?
0
votes
0answers
65 views

How to tell if a person has modified any content on a SharePoint site programmatically?

We need to find out if a disgrunted employee has modified any content on any number of many SharePoint sites we have. Aside from how we are currently reviewing lists by modified date manually (...
1
vote
2answers
656 views

SP 2013: Moving subwebs within a site collection

Just wondering if anyone knows a quick solution for moving SPWebs, they need to be structurally moved (So no managed navigation solution) and they contain an SPWeb hierarchy (Export/import is out of ...
0
votes
1answer
175 views

Using EnsureUser with ADFS

I am trying to take some users and author them to list item posts. The SPWeb.EnsureUser() method works fine on a server only utilizing AD, but not one that is using ADFS. Here is my attempt at ...
1
vote
1answer
107 views

ThreadAbortException on SPWeb.ProcessBatchData

I am trying to update ~2000 list items with SPWeb.ProcessBatchData. After exception on all items at a time, I tried them in small batches like 100 and 200 but after executing first 1 or 2 batches i.e. ...
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 ...
0
votes
1answer
1k views

SPWeb.GetList issue on SPContext.Current.Web

When I call SPContext.Current.Site.RootWeb.GetList(someListUrl) I get a System.Runtime.InteropServices.COMException, but when I call the same method from a new SPWeb instance, it runs fine - why? // ...
0
votes
2answers
1k views

Removing SPWeb properties from its property bag with powershell

I need to remove properties from multiple places with powershell script. I tried many examples from net, with null assigning and using remove on Properties and AllProperties, or using method ...
0
votes
1answer
56 views

Error passing spweb and splist variables as function parameters

I need to pass SPWeb an SPList as function parameters: string check(SPWeb web1, SPList splist1){} Yet, web1.Title, splist1.Title throws errors: There is no Web named "/http://DevSite". Is ...
1
vote
0answers
38 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
67 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
159 views

How to use the AllowUnsafeUpdates on the LayoutsPageBase in SharePoint 2013?

I am trying create an application page and want to make sure that AllowUnsafeUpdates property is properly used. Please suggest me the proper usage of AllowunsafeUpdates from the following code. I ...
1
vote
2answers
193 views

Code Review Question about disposing

Don't web.Dispose() dispose parent SPSite object? Is it Ok if I do this in web part? { SPSite site = SPContext.Current.Site; using (SPWeb web = site.OpenWeb(s)) { ...
2
votes
2answers
240 views

When should I set the AllowUnsafeUpdates property? [duplicate]

It mentioned that we should set "AllowUnsafeUpdates" to true, when the web object is not created from the SPContext. However should I still need to set as mentioned below? SPWeb web = SPContext....
0
votes
1answer
112 views

Remove-SPWeb - content database

Does the command Remove-SPWeb remove the web also from the content DB? I have a site collection with 10 webs, the size is around 100GB, I wish to remove some webs and reduce the size of the content ...
0
votes
3answers
2k views

SPSite and SPWeb object dispose inside foreach loop

I have a code that loops through all the Sites and Webs in a web application. My code uses for..each loop to navigate through each site and web object. I was wondering if we are required to dispose ...
5
votes
4answers
5k views

Get SPWeb by ID without Site Collection?

I have a list of SPWeb IDs and would like to open the associated SPWeb objects. However, I do not know in which Site Collection they are (I DO know that they are in the current Web Application though)....
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
190 views

Sharepoint 2013 Search: Get parent web information

I've a search result of different webs and I Need to know to which parent web they belong. Is it possible via search to get Information from the parent object? Thank you Markus
0
votes
1answer
442 views

How to get the URL of an item's parent web in JavaScript?

Given an absolute URL to an item, like: http://server/sites/mysite/myweb/Lists/MyList/DispForm.aspx?ID=1 or the absolute URL to the item's parent list, like: http://server/sites/mysite/myweb/Lists/...
2
votes
1answer
239 views

Get-SPWeb with a cross domain url throws an excepton

I want to migrate list items held in our dev sharepoint farm to site collection hosted on our live farm. Ok I have RDPed onto the server and I am running ISE as administrator I do another account I ...
1
vote
1answer
2k views

Get N Number of subwebs for specified web

How to get All Subwebs upto N Levels for Specified Web. eg. My Site url is... "http://server/web1" I need all subwebs upto N Levels for web1.. below line get all subwebs upto N Levels of ...
0
votes
1answer
22 views

Question on SP 2013 calculation

reguarding this questiong How do i Generate different calculations depending on what item is selected in drop down box? How would I do this calculation? while the calculation for ISDN is = ((len_26 +...
0
votes
1answer
328 views

SPWeb.GetListItem behavior

I am currently trying to retrive a Sharepoint item given it's URL. The URL would be an absolute URL or a relative URL. To achieve this, I am using the SPWeb.GetListItem(string url) method. I observed ...
1
vote
2answers
1k views

Changing language programmatically

I am having some problems in changing the language in SharePoint programmatically. I have two language packs installed on my server (Norwegian and English). If I change the language manually through ...
0
votes
1answer
852 views

Get a sharepoint web name from sharepoint site

spsite site =new spsite(/sites/gvr/); spweb web=site.openweb(); I'm getting all my subsites here, like /sites/gvr/test1 sites/gvr/test I need only subsite name like test1 or test2. Please let ...
2
votes
4answers
4k views

SharePoint 2010 - Add WebPart to a Web with PowerShell

I want to add a webpart to a great number of existing pages. Is there any PowerShell command to add a webpart to a webpart page?
5
votes
2answers
14k views

Getting SPWeb in feature receiver

While testing my solution I receive an error on Feature activation: Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects ...
2
votes
1answer
3k views

Get server-relative URL from SP.Web

I'm trying to retrieve a relative url from a SP.Web I get my sp.web from a SP.list with SPWeb test = listNL.ParentWeb; When I try to get the url I got an exception: test.ServerRelativeUrl' ...
2
votes
1answer
2k views

Adding SPListItem using SPWeb.ProcessBatchData method

I am looking for adding SPListItem using SPWeb.ProcessBatchData method. Could any one please help me on syntax for adding list item to my custom list.
1
vote
3answers
747 views

Check if URL is a valid SPWeb in an SPSite

I have a URL and I want to check if it exists as sub-site for a given URL. I have a URL = www.go.com I want to check if = www.go.com has URL = www.go.com/abx or not I have +1000 sub webs, do I ...
3
votes
2answers
825 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
992 views

Can't get granular file .bak or .cmp to restore. “Unable to read cabinet info”

I made a granular backup of my site collection into .bak. and now I'm trying to import said file by using Import-SPWeb -identity http:testserver/sites/test -path \\sharedstore\backup.bak I have the ...
0
votes
1answer
366 views

Uncommitted changes on SPWeb object

In my simple Powershell script, I keep getting an error "Exception calling "ResetRoleInheritance" : There are uncommitted changes on the SPWEb Object, call SPWeb.Update() to commit the cahnges before ...
0
votes
1answer
287 views

Can't delete SPWeb from PowerShell or C# Object Model

I have a very strange situation - two sub webs were created through some code but it errored out part way through the process and now I am left two webs I can't seem to delete. The strange part is ...
2
votes
2answers
1k views

What tool to use to check memory leaks in SharePoint

Currently I encounter memory leaks in my SharePoint 2007 application. What is the best tool to identify is there any un-dispose objects in the codes? Example like DataTable, SPWeb, or SPList.
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?