• Posts Tagged ‘PowerShell’

    Creating a Search Content Source of type Web using PowerShell

    by  • February 7, 2012 • PowerShell, SharePoint 2010 • 2 Comments

    The New-SPEnterpriseSearchCrawlContentSource command in Powershell is used to create a new crawl content source for a SharePoint search application.We can view the whole set of parameters and options in this msdn article. So , when we need to create a SharePoint Search content source, using Powershell, we use the following commands- $searchapp = Get-SPEnterpriseSearchServiceApplication "Search...

    Read more →

    Export WSP from Farm Solution Store using PowerShell

    by  • October 16, 2011 • PowerShell, SharePoint 2010 • 0 Comments

    In this article we will see how we can use PowerShell to export all WSPs from Farm’s solution store. Open SharePoint 2010 Management Shell and run the following PowerShell cmdlets. foreach($solution in Get-SPSolution) { try { $filename = $solution.Name; $solution.SolutionFile.SaveAs("D:\Allaboutmoss\WebParts\$filename") } catch { Write-Host "-error:$_"-foreground red } } Solution Store :...

    Read more →

    Get Solution ID using PowerShell

    by  • May 25, 2011 • PowerShell • 0 Comments

    Here is a quick PowerShell code to get the Solution ID $farm = ::Local foreach($currSolution in $farm.Solutions) { if($currSolution.Name -eq "SOLUTION NAME") { $solutionDetails = "Name: " $solutionDetails +=$currSolution.Name $solutionDetails += " ID:" $solutionDetails += $currSolution.id $solutionDetails } }

    Read more →

    Creating SharePoint list and add column programmatically

    by  • February 4, 2011 • MOSS 2007 • 5 Comments

    In this post we will see two methods for creating SharePoint list programmatically and add column to the created list Using Object model SPSite site = new SPSite(SPContext.Current.Site.ID); SPWeb web = site.OpenWeb(); SPListTemplate template = web.ListTemplates; web.AllowUnsafeUpdates = true; web.Lists.Add("MyList", "This list created using code", template); SPList mylist = web.Lists; mylist.Fields.Add("MyField", SPFieldType.Text,...

    Read more →

    How to Add calculated column in SharePoint list programmatically

    by  • February 1, 2011 • MOSS 2007, PowerShell, SharePoint 2010 • 0 Comments

    In this post we will see two methods for adding calculated field in SharePoint list. Using Object model SPSite site = new SPSite(SPContext.Current.Site.ID); SPWeb web = site.OpenWeb(); web.AllowUnsafeUpdates = true; SPList mylist = web.Lists; mylist.Fields.Add("CalcField", SPFieldType.Calculated, false); SPFieldCalculated CalcField = (SPFieldCalculated)mylist.Fields; CalcField.Formula = @"=CONCATENATE("" Calc : "",)"; CalcField.Update(); mylist.Update(); web.AllowUnsafeUpdates = false;...

    Read more →

    SharePoint 2010 Easy Setup Script

    by  • October 28, 2010 • SharePoint 2010 • 0 Comments

    Today Chris Johnson and I are releasing a new tool to help you setup a SharePoint 2010 developer machine. In order to make this process as easy as possible we have created a series of PowerShell scripts that automate the entire process of building a fully running and ready to go SharePoint 2010 environment....

    Read more →

    Setting a custom 404 error page for SharePoint

    by  • August 9, 2010 • MOSS 2007, PowerShell • 1 Comment

    In this article we will see how to set a custom error 404 (page not found) error page for SharePoint. Log on the sharepoint server and access the language folder in layout of IIS (% systemdrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\LangID) Note: In this path, LangID represents the actual Locale ID of the language...

    Read more →