Send Email with PS

Send-MailMessage -From “email address” -To “email address” -Subject “Test email” -Body “Test” -SmtpServer “SMTP server address”

Set offline database

ALTER DATABASE <dbasename> SET OFFLINE WITH
ROLLBACK IMMEDIATE
GO

How to force drop database in SQL

USE master;
ALTER DATABASE [databasename] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE [databasename] ;

Cannot see a SQL Configuration Manager

sqlservermanager11.msc

Rename SharePoint Web Application Name

$WA = SPWebApplication | where {$_.Name -match “OldName”}
$WA.Name =”NewName”
$WA.Update()
Get-SPWebApplication | where {$_.Name -match “NewName”}

Embed Smooth video in SP

<iframe width=”640″ height=”390″ src=”http://mediasite.com” frameborder=”0″ allowfullscreen></iframe>”

Add listener to AlwaysOn Cluster

ALTER AVAILABILITY GROUP sp2013
ADD LISTENER ‘lisname’ ( WITH IP ( (‘192.168.0.1′,’255.255.255.0’) ) , PORT = 1433 );
GO