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

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

Adding SharePoint PowerShell snapins

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :SharePoint
Hello All, I am new to both working with PowerShell and Servers originally performing more frontend development. That said, I am now working with SharePoint Srever 2010 of which is installed on Server 2008 (non-R2 version). I have PowerShell installed however every time I want to run Backup, Restore commands I am alwasy having to add: Add-PSSnapin Microsoft.SharePoint.PowerShell. Is there a way to permanantly add this snap in so I don't have to add it every single time? is there a way to permanantly add any and all sanpins so I don't experience any unrecognizable cmdlets? Don't want to make others angry but I amnot seing what all the praise is about in PowerShell at the moment.

View Complete Post

More Related Resource Links

adding a SharePoint content source using powershell

Hi I'm trying to create a content source using powershell and (I'm not a programmer) I've got this far -   [System.Reflection.Assembly]::Load("Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.Sharepoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.Office.Server, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") $site = new-object Microsoft.SharePoint.SPSite("http://breakfast/ssp/admin") $searchContext = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($site)  $content = new-object Microsoft.Office.Server.Search.Administration.Content($searchContext) $Content.ContentSources; --> and now I'm stuck! I think I can use the Create method with type and name parameters but I can't work out how to translate this into powershell This is the code I'm looking at: ContentSource contentSource_com = content.ContentSources.Create(typeof(WebContentSource), "www.someurl.com"); WebContentSource webContentSource_com = (WebContentSource)contentSource_com; webContentSource_com.StartAddresses.Add(new Uri("http://www.someurl.com/index.html)); webContentSource_com.Update(); and $contentsource = $content.ContentSources.

Adding Search Refinements in SharePoint 2010

I have been playing around with SharePoint 2010 Search this morning. I love the new UI. The search refinements panel is just begging to be messed with. In my case I wanted to add the file extension JPG as an Image Type refiner.

Adding a custom ASP page to a sharepoint 3.0 site


I have a custom ASP page that I need to add to my sharepoint 3.0 web site.  I created a virtual directory under my website and placed the ASP file.  When I link to the ASP file, I get a 404 page not found.  To make sure I had the correct URL path, I created a test html file and placed in the same virtual directory and linked to it just fine.  I think it has something to do with managed paths and sharepoint trying to control this new ASP content.  I cannot figure out how to exclude this content from managed paths.

Any suggestions on how to resolve this issue so I can run this custom ASP file under sharepoint 3.0?


Video: SharePoint 2010 Integration with PowerShell

Learn about the new PowerShell integration in SharePoint 2010, which brings SharePoint administration in line with other server products such as Exchange. Understanding PowerShell is a must-have skill for SharePoint 2010 developers. (Length: 19:52)

Video: Adding SharePoint 2010 Project Items to a C# or VB.NET Project

Each project is either a C# or VB.NET project that contains particular initial project items. In addition Visual Studio 2010 includes SharePoint project items that you can add to any of your projects. (Length: 18:53)

PowerShell script to add/edit ContentEditor webpart on SharePoint 2010

Hi all, I'm new to PowerShell scripting with SharePoint. Following are the requirements that were given to me. Can any one direct me in the right direction interms of writing the script and how to save and execute the script? I am aware of Cmdlets. 1. Cycle through all sites in site collection 2. For each site, retrieve all document libraries 3. Look for specific CMV document library name (ie value communication, key business drivers, etc)          o add content editor web part if doesn't exist          o add/update appropriate description based on the document library name Thanks in advance...

Cannot install Sharepoint 2010 from powershell

I have been given the task of installing Sharepoint 2010 onto a Windows Server 2008 fresh OS. I am attempting to do this using Powershell as we will likely have to rebuild this machine later so i want the rebuild to be as quick as possible. I have setup the SPModules in powershell and add the path to to the PSModule variable. When i run the following command: PS C:\Windows\system32> Install-SharePoint -SetupExePath "location of software\setup.exe" -ConfigXML "location of software\Files\SetupFarm\config.xml" -PIDKey "my key" i get the error: Property 'Value' cannot be found on this object; make sure it exists and is settable. At D:\SPModule\spmodule.setup\Install-SharePoint.ps1:373 char:52 +             $CurrentConfigXml.Configuration.PIDKEY. <<<< Value = $PIDKey     + CategoryInfo          : InvalidOperation: (Value:String) [], ParentContainsErrorRecordException     + FullyQualifiedErrorId : PropertyNotFound even though the key is an argument. I then added the key to a copy of the config file and ran following: PS C:\Windows\system32> Install-SharePoint -SetupExePath "location of software\setup.exe" -ConfigXML "location of software\Files\SetupFarm\configpidkey.xml"

Sharepoint Designer: ErrorMessage in Designview after adding new PlaceHolder to masterpage

Hi! I added a new PlaceHolder to the masterpage of my SharePoint-Site. Now when I switch to DesignView of a page which uses this masterpage in SPD most of the other PlaceHolders are not displayed and show a error message like "Error on creating control. Response is not available in this context". How do I prevent this problem? And what is the cause? Thank you very much for answers! Gerrit

Adding a custom control to the SharePoint 2010 Team Site Wiki Page Template ( wkpstd.aspx ) programm

Topic This is maybe my last post about the Team Site Wiki Page customization with the aim of exceeding its limitations. This time we are going to customize the unique template ( wkpstd.aspx) by replacing the control that renders the editable content by a custom one. In this post example, we will take advantage of the use of this custom control to render not editable additional contents, for instance, a header and a footer that could be the same for a specific Wiki Page Library. Of course, we are not going to really customize the template, but we are going to use a delegate control to replace the control at runtime. Here are the screen shots of the result: We can see a non editable Header and Footer on the Team Site Wiki Page In edit mode these additional contents are not rendered, but we can add new content as usual And of course, after having saved the page, the new content is rendered wtih the non editable Header and Footer. Steps required   If you look at the Team Site Wiki Page template, wkpstd.aspx, you can see the control that is rendering the editable content/ <SharePoint:EmbeddedFormField ID="WikiField" FieldName="WikiField" ControlMode="Display" runat="server" /> We are first going to create a custom EmbeddedFormField control Then, we are going to use a delegate control to replace the native EmbeddedFor

Adding custom fields into the sharepoint

Hi, As i am not aware of adding custom fields into sharepoint i have followed as per the link http://www.sharepointkings.com/2010/06/creating-custom-field-in-sharepoint.html but i couldn't integrate the custom field so if you have any step by step process of creating and adding custom fields in sharepoint link please let me know Thanks & Regards, Sudheer

Adding multiple holidays to a SharePoint Calendar

I have a need to add US, Canadian and UK holidays to a corporate wide calendar. Is there a way to have SharePoint auto input these holidays for me or do I have to add them into a calendar overlay by hand. I can have outlook add holidays automatically it seems odd that SharePoint can't. Any suggestions?

Create site template and adding subsite using site template is broken in sharepoint 2010

I am trying to create a site template base on an existing site and try to use the new site template to generate other sub-sites.  It sounds simple and the code is not that difficult to follow; however, Microsoft has made it impossible to accomplish by having a bug in their template creation process.   //Generate web template from existing website using (SPSite site = new SPSite("http://localhost")) { SPWeb web = site.OpenWeb("/barrington/accounting"); web.SaveAsTemplate("NewDepartmentTemplate", "NewDepartmentTemplate", "NewDepartmentTemplate", true); }   //Generate sub site using the new template using (SPSite site = new SPSite("http://localhost")) { SPWeb web = site.OpenWeb("/barrington/accounting"); SPWebTemplate tp = null; foreach (SPWebTemplate wt in web.GetAvailableWebTemplates((uint)1033)) { if (wt.Title == "NewDepartmentTemplate") { tp = wt; break; } } if (tp != null) { SPWeb newWeb = web.Webs.Add("NewDepartment", "NewDepartment", "NewDepartment", (uint)1033, tp, false, false); } } Error: Microsoft.SharePoint.SPException was unhandled   Message=The content type name '$Resources:_FeatureId367b94a9-4a15-42ba-b4a2-32420363e018,DataSourceContentTypeName;' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive per

Sharepoint slide library adding functionality.

The slide library in Sharepoint allows you to upload Powerpoint slides to it, then to copy a slide to a new presentation and edit it, or check it out so you can edit it and check back in the changes. Unfortunately the ability to check out multiple slides at once to edit is not possible, only the ability to copy them to a new presentation, so you lose all data stored with them.  I am trying to find a way to be able to check out multiple slides at once, then be able to check them in when you have made changes.   My questions are basically:  Can I add a button to the Sharepoint slide library interface? How can I interact with the client machine in terms of opening Powerpoint and getting them to be able to check out the slides? I have the Sharepoint VSTO tools installed and this must be for Sharepoint 2007. Thanks  

SharePoint Designer adding __designer attributes

Hi, I am hoping someone knows a why to shut this functionality off. Everytime I open my master page in SharePoint designer it adds __designer:Preview and __designer:Values attributes to my FieldValue and Literal controls, and if I don't remove them before I check in ASP.NET complains. Does anyone know how to stop SharePoint designer from doing this or is there an attribute I can set on the controls to stop it? <SharePoint:FieldValue FieldName="Title" runat="server" __designer:Preview="XXXXX" __designer:Values="XXXXX"/> Thanks in advance.

Sharepoint Blog Site, adding sub-categories

Hello, Looking for help using a blog site I need to create sub-categories under Categories that are located  in the Quick Launch area and also be able to add to sub-categories when needed, plus click the sub-category and it will open the post under that sub-category. I hope that I am making sense.  Thank you so much, JAM

Adding SharePoint Toolpart to SQL Report viewer

I am new to the Business Intelligence Project plug in for Visual Studio. I have a SQL Report created in Visual Studio using the Business Intelligence Report Server Project.  I am hosting the report in a SharePoint Report Viewer Web part. I have 2 questions:  1.  Is it possible to create a code behind module for the report in C#?  The only codebehind module I see is in XML.  I have seen many posts with C# code in them however they do not explain how to get to the code behind. 2.  Is it possible to pass values from a SharePoint Toolpart to a SQL Report (via the Report Viewer web part) and use the value to generate the report? Thanks in advance.

Adding content to 3 sharepoint lists in a single form/workflow


Hi Folks,

I know there has to be a better way of doing this.

I am setting up a staff training intranet site. the main objectives is to keep a history of what training has been undertaken by company employees.

the solution I have at the moment is

1) create a SharePoint list item on a list called training provider ( for the provider of the training course )

2) create a SharePoint list item on a list called training ( one of the columns is a lookup on the training provider list )


3) create a list item on a list called training schedule which links the employee and the training course.

Going forward I would like the employees themselves to be able to enter the details of the training courses themselves.

I'm concerned that the above process is unwieldly/cumbersome.

Is infopath the way to go ? would a solution involving workflow be better ?



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