.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Powershell Set-SPWeb Error?

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#

I'm trying to use Set-SPWeb in order to set the Title and Description for a site.

I've visited this article on Technet and MSDN:  http://technet.microsoft.com/en-us/library/ff607732.aspx

I've used Get-Help Set-SPWeb -detailed, which reports pretty much everything in that article above.

According to the article and the available help, an optional parameter is "NAME" which "Specifies the new name of the Web."  But for the Example provided, it gives -Title "My Site Title"

The kicker, and my reason for writing, is that when I use Set-SPWeb with either a -Name parameter as the article says, or the -Title parameter as the example gives, they both kick back at me "A parameter cannot be found that matches parameter name 'name'." (or 'title')

Is anyone out there able to confirm that this is a bug in the documentation ... or give me another way to accomplish this? 


Edited to add:  I had no trouble running this command with the -Description parameter, which works great. I also have no trouble running other Powershell commands such as Import-SPWeb, Export-SPWeb, Get-SPWeb.  So it's not a general Powershell issue. 

Lady_M MCITP SharePoint 2010

View Complete Post

More Related Resource Links

SQL Server Powershell script error!

Hi, I get the following error while trying to execute a powershell script. New-Object : Cannot find type [Microsoft.SQlServer.Management.Sdk.Sfc.SqlStoreConnection]: make sure the assembly containing this type is loaded. I'm trying to implement policies across different sql server instances from a primary instance. The script can be found @ http://blogs.msdn.com/sqlpbm/archive/2008/06/14/running-against-sql-server-2005-and-sql-server-2000.aspx Thanks for your help.

Export-SPWeb "cannot find spweb object with id or url" error

How do we just export and import a library or a list using Export-SPWeb and Import-SPWeb? I tried exporting just a library with Export-SPWeb, but it throws an error : Could not find an SpWeb Object with Id or URL “http://<server:port>/Shared Documents”. The same thing goes for a simple list like Tasks: "http://<server:port>/Lists/Tasks". Any help would be much appreciated

Error opening site using SPSite and SPWeb instances using VS 2010, Win Server 2008 R2


Hi I am trying to open my site using SPSite and SPWeb instances and getting an error message as below-

The Web application at http://url could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

  CODE is -



                    SPSite siteCOll = new SPSite(siteURL);

                    SPWeb oWeb = siteCOll.OpenWeb("url");



I can access site using browser perfectly.

I am running VS as administrator.

I have done permission checking aswell.


please help!





SQL Agent Job - PowerShell step giving escape token error



I'm confused as to why I'm getting this error:

The job step contains tokens. For SQL Server 2005 Service Pack 1 or later, you must use the appropriate ESCAPE_xxx macro to update job steps containing tokens before the job can run.).  The step failed.

The job is a single Powershell script step like this:


Get-ChildItem -path "\\server\share-Logs\" -recurse -include *.log | Where-Object {($_.CreationTime -le $((Get-Date).AddDays(-35)))} | Remove-Item


This runs fine from the PS command-line but after testing this part is causing the error: $(Get-Date.AddDays(-35)) , in the Job step

This isn't TSQL or a token - so I don't understand why it doesn't just get put as-is into the PS command-line when the job runs.

Any help appreciated.


Error occured when using SPWeb or SPSite in webpart


I am creating a custom webpart, in which I have a label control. This label will display the current site URL and here is the code

protected override void CreateChildControls()
            SPWeb wb = SPContext.Current.Web;
            string baseURL = wb.Url.ToString();
            Label lblTitle = new Label();
            lblTitle.Text = baseURL.ToString();

But when I try to use SPWeb or SPSite within CreateChildControl method, I am getting an unexpected error occurred message. Also I have used "using Microsoft.SharePoint;" too.

If suppose I comment those two line my web part is displaying the properly. As below

protected override void CreateChildControls()
            //SPWeb wb = SPContext.Current.W

Import-SPWeb, List does not exist error

I have a strange problem with custom lists in an imported site.
After exporting the site in Central Admin by clicking "Export a site or list" and importing it with "Import-SPWeb" (on a different farm), I cannot read or create new items in custom lists in the imported site. However, by code, i.e. using PowerShell or custom Web Parts, I can read items in the list without any problems.

If I click on any item in a list however, I get an error saying "List does not exist. The page you selected contains a list that does not exist.  It may have been deleted by another user."

I guess it has something to do with permissions, since I get an "Access denied" error when trying to create new items through the browser. The permissions settings seem fine in the browser though...

EDIT: This seems to occur only on lists where I have created custom list forms, like Disp and Edit pages. I guess it has something to do with these files. Are any one else having the same problem?

EDIT 2: Correction, this occurs on every list.

SPWeb error on navigation configuration

    Hi. I have a problem regarding the SPWeb error ("Trying to use an SPWeb object that has been closed or disposed and is no longer valid"). I am a site administrator, and we keep gettin that problem on a few sites. After doing some research on the net, they recommend everywhere to not dispose the SPWeb object, but we haven't made no code modifications, so we still have no clue as why this is happening.

    We get the error when trying to access to the AllItems page of a list or document library. We noticed that this only happens when you select 'show navigation under current site' on Site Configuration > Exploration, and there are no other sites created under the current one. Then, if you clic on some list on the 'All Site Content' page, it shows the SPWeb error message.
    The easiest way to solve this was to create empty sites under the ones on which we wanted to choose that navigation configuration, and then hide them. It seems like having a site under itself helps to recover the reference to the SPWeb object.
    I don't know if this is a bug, the masterpage or site templates are corrupted, or maybe it's just like this, and Sharepoint doesn't allows you to choose 'show navigation under current site' when there are no subsites under this one.


Stuck with a SQL restore via Powershell error


If this is not the right forum, apologies. I've been tasked with setting up a test environment for an application currently in Production. It uses SQL as a backend and it currenlty has 240+ databases on its SQL cluster. We are ready to do a release update of the app, thus my task to create a test environment that currently mimics whats on production. My main issue right now is with the SQL backend. I have to backup all the 240+ databases in prod and restore them on a SQL server on the test environment. As part of the restore process I also have to change the path for the mdf and ldf files. I don't want to manually do this 240+ times. So I though of using Powershell for the task.

With the help of some google searches I've put together this script to handle the task:


# clear console
#load assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null
[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null

Instalation Error PowerShell Windows


Hi, I have an error during instalation of SQL Server 2008 R2, says that I have to install Windows PowerShell. I already download and install it, but the error continues.

I made the download from here : http://www.microsoft.com/downloads/en/details.aspx?FamilyId=6CCB7E0D-8F1D-4B97-A397-47BCC8BA3806&displaylang=en


Anyone knows how I solve this problem?



IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


Handling 404 page not found with Error page



      How do i handle 404 page not found?

Inserting personal error message in ValidationSummary



I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:



Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

        public static string aaa(int i)
            return i.ToString();

        public static string aaa1(int i)
            return i.ToString();



        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <span id="displayspan"></span>
        <br />
        <input type="button" value=

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


HTTP Error 403 - Forbidden


(VB Express website directed me to ASP.NET Web Services which in turn redirected me to this forum).

 Hopefully someone can help me here...... 

I am using VIsual Web Developer and downloaded the small business application to use as a starting point to help my wife get a website up for her small business. When I load the application, I can F5 and it runs fine but as soon as I make any modification to the app and hit F5, I get the HTTP Error 403 - Forbidden when it tries to show the website.

I notice a pop up that occurs when I run that allows me to choose the link for my app and it displays correctly (I close the webpage that has the error on it).

This seems like a pain, is there a setting I'm missing - I would think that this should "just work".

What's up?????



Webmatrix error


When i try to do anything in webmatrix it shuts down.   i get this error in the log

pplication: WebMatrix.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Unrecoverable system error.
   at System.Environment.FailFast(System.String)
   at MS.Internal.Invariant.FailFast(System.String, System.String)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend