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 filesinternet 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.

Script to Pin Programs to the taskbar
Author:  Jonathan of
Version: 1.0.0
$shell = new-object -com "Shell.Application"
# Internet Explorer
$folder = $shell.Namespace('c:\program files\internet explorer')
$item = $folder.Parsename('iexplore.exe')
# MDT Deployment Workbench
$folder = $shell.Namespace('C:\Program Files\Microsoft Deployment Toolkit\Bin')
$item = $folder.Parsename('DeploymentWorkbench.msc')
# AD Users and Computers
$folder = $shell.Namespace('c:\windows\system32')
$item = $folder.Parsename('dsa.msc')
$folder = $shell.Namespace('c:\windows\system32')
$item = $folder.Parsename('dhcpmgmt.msc')
$folder = $shell.Namespace('c:\windows\system32')
$item = $folder.Parsename('dnsmgmt.msc')
# Group Policy
$folder = $shell.Namespace('c:\windows\system32')
$item = $folder.Parsename('gpmc.msc')
$folder = $shell.Namespace('c:\program files\update services\administrationSnapin')
$item = $folder.Parsename('wsus.msc')
$folder = $shell.Namespace('c:\windows\system32')
$item = $folder.Parsename('WdsMgmt.msc')

Thanks, and Happy New Year to all my readers!

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *