Using PowerShell to view Site created on the previous day


How to view name of the SharePoint sites which was created previous day?

$w= Get-SpWeb http://yoursite
$date=$w.created
$old=($date.AddDays(-1))
Get-SPSite -Filter {$w.Created -eq $old}
Advertisements

PowerShell Tips for SQL Server


http://blogs.technet.com/b/heyscriptingguy/archive/2013/05/06/10-tips-for-the-sql-server-powershell-scripter.aspx

A Site Collection could not be created as the provided managed parth dose not exist


Creating one Content Database Per Site Collection In SharePoint 2010 using Windows PowerShell

One of the most common problems I see in a client built SharePoint environment is multiple site collections comingled in the same content database.  While this isn’t the end of the world, it’s a problem because SLAs, security, and even back strategies are often assigned to specific databases based upon the needs of the users that will be using the site collections hosted in each database.  If a site collection is not hosted in the database that the admin intended because SharePoint simply picks the first available content database with room  the administrator may unwittingly incorrectly back or, even worse, fail to backup a particular site collection because it does not exist in the proper database.  This is why I am a proponent of backing up at the Native SQL level but also at the site collection level.

On to the point of this article, how do I use PowerShell to create a site collection and assign the appropriate database

Here are the steps to how you can create Content Database Per Site Collection In SharePoint 2010 using Windows PowerShell

Download SharePoint 2010 prerequisites


How do I download all the the prerequisites files for SharePoint 2010 installation?

Situation:
I need to install SharePoint 2010 in DMZ and the server is not having any access to internet.

Solution:
Downloaded all prerequisites for SharePoint 2010 in Windows 7 computer which is connected to internet and transferred to the server which I want to install SharePoint 2010

1. In Windows 7 I ran C:\Windows\System32\WindowsPowerShell\v1.0

Open powershell script editor in Windows 7

2. Open PowerShell folder and run powershell_ise.exe

Download SharePoint 2010 prerequisites

 

3. Download SharePoint 2010 prerequisites script  (copy and past it into powershell editor) and run the script

image

4. Enter the destination path for download SharePoint 2010 Prerequisite files and click OK

image

5. Downloading SharePoint 2010 Prerequisite files to the folder which we entered

Downloading SharePoint 2010 prerequisite in a folder

Change SharePoint 2010 central admin port


How to change SharePoint 2010 central admin port using Power Shell?
You can change the port central administration Port number using Power Shell command below

If your Central Administration Port number is 8080 and you want to change to 8081
Set-SPCentralAdministration –Port 8081