Pin Items to Task Bar

Problem:  How do I pin items to the taskbar during deployment?

Solution:   After deployment of a server I feel its nice to have your common programs pinned to the taskbar to enable quick launch after you’ve finished.  In my line of work we have three main servers we use at each site and we separate roles & services accordingly.  The script below covers pinning a few different items to the task bar some programs some MMC Consoles.  This is one script made from 3, feel free to edit as you see fit and drop parts onto other scripts.

First we declare $shell as a new object with the type configured as “Shell.Application”

   1: $shell = new-object -com "Shell.Application" 

Then we specify the folder where the program resides

   1: $folder = $shell.Namespace('c:\program files\internet explorer')

The name of the program within that folder (including the file extension)

   1: $item = $folder.Parsename('iexplore.exe')

And finally pin it to the taskbar

   1: item.invokeverb('taskbarpin')

I have selected parts of the script below running at the end of my task sequences for each of my servers, pinning the most commonly used programs to the taskbar for use by other admins and myself when remoting on.

Here is the scripts i put together this morning, it includes taskbar pins for:

  • Internet Explorer
  • MDT Deployment Workbench
  • AD Users and Computer
  • DHCP
  • DNS
  • Group Policy
  • WSUS
  • WDS

It should also give you a head start on how to edit this for your specific needs.

   1: <#
   2: Script to Pin Programs to the taskbar
   4: Author:  Jonathan of
   5: Version: 1.0.0
   7: #>
   8: $shell = new-object -com "Shell.Application"    
  10: # Internet Explorer    
  11: $folder = $shell.Namespace('c:\program files\internet explorer')   
  12: $item = $folder.Parsename('iexplore.exe')  
  13: $item.invokeverb('taskbarpin')  
  15: # MDT Deployment Workbench  
  16: $folder = $shell.Namespace('C:\Program Files\Microsoft Deployment Toolkit\Bin')  
  17: $item = $folder.Parsename('DeploymentWorkbench.msc')  
  18: $item.invokeverb('taskbarpin')  
  20: # AD Users and Computers  
  21: $folder = $shell.Namespace('c:\windows\system32')  
  22: $item = $folder.Parsename('dsa.msc')  
  23: $item.invokeverb('taskbarpin')  
  25: # DHCP  
  26: $folder = $shell.Namespace('c:\windows\system32')  
  27: $item = $folder.Parsename('dhcpmgmt.msc')  
  28: $item.invokeverb('taskbarpin')  
  30: # DNS  
  31: $folder = $shell.Namespace('c:\windows\system32')  
  32: $item = $folder.Parsename('dnsmgmt.msc')  
  33: $item.invokeverb('taskbarpin')  
  35: # Group Policy  
  36: $folder = $shell.Namespace('c:\windows\system32')  
  37: $item = $folder.Parsename('gpmc.msc')  
  38: $item.invokeverb('taskbarpin')  
  40: # WSUS  
  41: $folder = $shell.Namespace('c:\program files\update services\administrationSnapin')  
  42: $item = $folder.Parsename('wsus.msc')  
  43: $item.invokeverb('taskbarpin')  
  45: # WDS
  46: $folder = $shell.Namespace('c:\windows\system32')  
  47: $item = $folder.Parsename('WdsMgmt.msc')  
  48: $item.invokeverb('taskbarpin')

Thanks, and Happy New Year to all my readers!


Comments (3) -

Jose Espitia 5/24/2016 7:27:03 PM

This doesn't work in Windows 10 because they removed the pintotaskbar verb!

However after many attempts, I was able to pin icons to the taskbar by using a tool called Syspin and you can download it from the following link:

To pin IE, you can use the following command:
syspin “%PROGRAMFILES%\Internet Explorer\iexplore.exe” c:5386

I posted more info about this on my site:

Hope this helps someone out there because I spent a lot of time trying to find a way.

Thanks Jose!  Approved your comment hopefully this will help someone else.

Jose Espitia 6/22/2016 8:58:11 AM

No problem, I hope it helps!

Add comment