T The Triage ManualTechnical Guides for IT Emergencies
P4 · Endpoint & Device Management

Programmatically Pin and Unpin Taskbar Apps in Windows 11 via PowerShell

Windows 11 lacks a native PowerShell cmdlet for managing taskbar pins, and the methods used in Windows 10 no longer function reliably. Administrators can use the Shell.Application COM object in PowerShell to invoke 'taskbarpin' and 'taskbarunpin' verbs against target executables or shortcuts. For enterprise-wide rollout, the script is deployed via Group Policy logon scripts or scheduled tasks to ensure consistent taskbar configuration across new and existing user profiles.

Indicators

Likely causes

Diagnostic steps

  1. Verify the Windows 11 build version on affected endpoints: Get-ComputerInfo | Select-Object WindowsVersion, OsBuildNumber — confirm compatibility with Shell.Application verb approach for that build.
  2. Inspect current pinned taskbar items via registry: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband — review binary data to understand existing pins before modification.
  3. Identify the full path of the target application executable or .lnk shortcut that needs to be pinned or unpinned (e.g. C:\Program Files\MyApp\MyApp.exe or a Start Menu shortcut).
  4. Test the pin verb interactively in PowerShell as the target user: $shell = New-Object -ComObject Shell.Application; $folder = $shell.Namespace('C:\Path\To\App'); $item = $folder.ParseName('App.exe'); $item.InvokeVerb('taskbarpin')
  5. To unpin an application, invoke the unpin verb against the same item: $item.InvokeVerb('taskbarunpin')
  6. If changes are not immediately visible, restart Explorer to apply: Stop-Process -Name explorer -Force — then verify taskbar state visually or by re-inspecting the Taskband registry key.
  7. Confirm the script runs correctly under a standard user context (not elevated), as taskbar pins are per-user and HKCU-scoped — running as SYSTEM will not produce the expected result.
  8. For enterprise deployment, wrap the validated script in a GPO logon script or a scheduled task triggered at user logon, scoped to the target OU or device group.

Resolution path

Prevention

Tools

References

Windows 11PowerShellTaskbarPin AppUnpin AppShell.ApplicationCOM ObjectEnterprise DeploymentUser Profile ManagementGroup PolicyIntuneLogon ScriptAutomationEndpoint Management