Pin SharePoint admin tools to the taskbar

Topics: Feature Requests
Mar 20, 2014 at 12:05 PM
The following script will pin SharePoint powershell & Central Admin, SQL Management Studio and Event Viewer, and unpin vanilla powershell.
$shell = new-object -com "Shell.Application"  


#Pin SharePoint
#Namespace 23 = C:\ProgramData\Microsoft\Windows\Start Menu\Programs
$sp=$shell.NameSpace(23).ParseName("Microsoft SharePoint 2013 Products")
if ($sp -eq $null)
{
    $sp=$shell.NameSpace(23).ParseName("Microsoft SharePoint 2010 Products")
}
if ($sp -ne $null)
{
    $sp.GetFolder.ParseName("SharePoint 2013 Management Shell.lnk").InvokeVerb('taskbarpin')
    $sp.GetFolder.ParseName("SharePoint 2013 Central Administration.lnk").InvokeVerb('taskbarpin')
}

#Pin SQL if present
$sql = $shell.NameSpace(23).ParseName("Microsoft SQL Server 2012")
if ($sql -eq $null)
{
    $sql = $shell.NameSpace(23).ParseName("Microsoft SQL Server 2008R2")
}
if ($sql -eq $null)
{
    $sql = $shell.NameSpace(23).ParseName("Microsoft SQL Server 2014")
}
if ($sql -ne $null)
{
    $sql.GetFolder.ParseName("SQL Server Management Studio.lnk").InvokeVerb('taskbarpin')
}

#Pin IIS
#Namespace 37 = C:\Windows\System32
$shell.NameSpace(37).ParseName("InetSrv").GetFolder.ParseName("InetMgr.exe").InvokeVerb('taskbarpin')


#Unpin vanilla powershell
$shell.NameSpace(37).ParseName("WindowsPowerShell").GetFolder.ParseName("v1.0").GetFolder.ParseName("powershell.exe").InvokeVerb('taskbarunpin')

#Event viewer
$shell.NameSpace(23).ParseName("Administrative Tools").GetFolder.ParseName("Event Viewer.lnk").InvokeVerb('taskbarpin')


    
Mar 20, 2014 at 1:45 PM
Nice!
I never thought about doing this!
Mar 26, 2014 at 1:40 AM
Actually there is a bug in that code for SharePoint 2010 - it is using '2013' in the names of the links to pin.