Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

PowerShell

SharePoint 2010 Management Shell – “Run As Admin” always

Today while watching Todd Klindt’s webcast with Idera, a cool trick was shared to avoid having to always right click and run as administrator.   You simply need to right click the icon you have, click the “Advanced” button, and check the “Run as administrator” box.    This will keep the setting permanently to make it easier to use.   

Since we’ll probably be in Powershell every single day it’s a good trick to know about. 

Smile

 

image

image

 

image

Toggle Developer Dashboard

Here are the commands to change the global developer dashboard setting in SharePoint 2010 and 2013.

OnDemand Mode:

On Mode:

Off Mode:

STSADM command line:

 

image

Making a cozy PowerShell home

During the Chicago SharePoint 2010 road show (#SharePointRS) Darrin Bishop (@bishopd) showed us a cool admin trick with the below command:

Add-PPSnapin Microsoft.SharePoint.PowerShell

NAME
    Add-PSSnapin

SYNOPSIS
    Adds one or more Windows PowerShell snap-ins to the current session.

SYNTAX
    Add-PSSnapin [-Name] <string[]> [-PassThru] [<CommonParameters>]

Every product shipping with Microsoft now seem sot have it’s own start menu icon and matching PowerShell console.   I’m a simple guy and prefer fewer icons.   So I changed my default profile.ps1 file (C:Documents and Settings%username%My DocumentsWindowsPowerShellprofile.ps1) to have all of the cmdlets loaded in one place.

It was a nice time saver for me, give it a try on your machine! 

Hot

 

image

PowerShell Out-Grid.ps1

NOTE – PowerShell 2.0 now includes the “Out-GridView” cmdlet which removes the need for this custom .PS1 script built for PowerShell 1.0

The current release of PowerShell V1.0 does not ship with any GUI tools.    V2.0 CTP3 comes with a scripting IDE and the Out-GridView cmdlet to help with adoption and ease of use.I personally find the Out-Grid.ps1 script very handy and copy to servers whenever I want to do heavy PowerShell work.   Check it out below.

If you see an error stating that “the execution of scripts is disabled on this system” then you’ll want to run “set-executionpolicy unrestricted

image
image
image

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲