MOSS 2007 – Find the default view url for all lists in a web app using PowerShell

param( $url = $(Read-Host -Prompt "WebApp Url"))# Default View for lists in All Sites# Lookup Web Application as specified in the command line parameter$wa = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($url) # Create an array $sites =@()Write-Output("`nProcessing sites…`n") # Loop through all site collections in the web applicationforeach($site in $wa.Sites){ foreach ($s in $site) { $spWeb = $s.openweb() foreach($list in…

0

Retrieve the list of Content Types in MOSS 2007 using PowerShell

  MOSS 2007 [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-nullWrite-host ".."Write-host ".."Write-host "Get a list of Content types"$site = new-object Microsoft.SharePoint.SPSite("http://spweb/extend"); # specify url hereforeach ($web in $site.AllWebs) { $ctypes = $web.ContentTypes foreach ($ctype in $ctypes) { $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages($ctype) foreach ($usage in $usages) { Write-Host $web.Name + "," + $ctype.Name + "," + $usage.Url } }} SharePoint 2010…

0

Warm up script in PowerShell for SharePoint 2010 Environment

    # Warm up script for web apps along with the site collections within them in SharePoint 2010 environmentAdd-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue # The get-webpage function is from http://kirkhofer.wordpress.com/2008/10/18/sharepoint-warm-up-script/function Get-WebPage([string]$url){ $wc = new-object net.webclient; $wc.credentials = [System.Net.CredentialCache]::DefaultCredentials; $pageContents = $wc.DownloadString($url); $wc.Dispose(); return $pageContents;} # Enumerate the web app along with the site collections within…

1

Retrieve timer job history for a specified time range using PowerShell

    # Retrieve timer job history for a specified time range # Initial settings $Wa = Get-SPWebApplication "http://WebAppUrl"    # Supply the web app url here $From= "2/13/2013 12:00:00 AM"  # mm/dd/yyyy hh:mm:ss $To = "2/14/2013 12:00:00 AM" # Retrieve all jobs in the time range Write-Host "Listing all timer jobs that have run between…

8

Create a new Search Service Application in SharePoint 2013 using PowerShell

  The search architecture in SharePoint 2013 has changed quite a bit when compared to SharePoint 2010. In fact the Search Service in SharePoint 2013 is completely overhauled. It is a combination of FAST Search and SharePoint Search components. As you can see the query and crawl topologies are merged into a single topology, simply…

12

Running PowerShell on MOSS 2007

  If you are running MOSS 2007 on Windows Server 2003 the you have to download and install PowerShell from http://support.microsoft.com/kb/968930. Windows Server 2008  natively supports PowerShell. Set the  Execution Policy to ‘RemoteSigned’. You can check it by running ‘Get-ExecutionPolicy’ cmdlet The default execution policy for PowerShell is “Restricted” (commands only, not scripts)      # All…

5

List Template types and IDs in SharePoint

To identify the template Id of the list, navigate to the list and go to the ‘All Items’ view. In the browser, go to ‘View – Source’ and search for “ctx.listTemplate”. The ‘Pages’ Library will show – “ctx.listTemplate = 850” and the ‘Images’ library will show “ctx.listTemplate = 101”. For other template types, you will…

4

PowerShell and PSConfig

    Just like the PSConfig command, we can also use PowerShell to configure the SharePoint farm from scratch. Though we can install SharePoint and create a new farm using PowerShell as well, I have not covered it under this this post. Below is a set of PSConfig commands and their equivalent cmdlet in PowerShell…

0