Archive

Archive for the ‘PoweShell’ Category

Powershell: Start-SPAssignment -Global


Powershell: Start-SPAssignment -Global
It allows you to assign a variable to a list of objects and provides you the ability dispose of those objects at any time in the script. You can assign a list of objects, like your SPSite, SPWeb objects and dispose of them when you no longer need them. It is very useful in memory intensive powerhsell applications.

AddFailOverInstance PowerShell


$fdb = Get-SPDatabase –Identity <id of database>
$fdb.AddFailOverInstance(“failover alias/sql”)
$fdb.Update()

Get WebApplication Name Using GUID

Manage hit highlighted summary for a managed property by using Windows PowerShell

SharePoint SPQuery List Internal Names


[system.reflection.assembly]::loadwithpartialname(“microsoft.sharepoint”)
$site= New-Object Microsoft.SharePoint.SPSite (“http://SP2010&#8221;)
$web=$site.OpenWeb()
$list=$web.Lists[“MyReadOnly”]
$list.Fields |select ID, title, internalname| more

In SPQuery you have to use internal Names only.

Windows PowerShell Integrated Scripting Environment Installation

SharePoint PowerShell Commands to get Feature List