Pin Icons to Start Menu for All Users with GPO

32 Flares Twitter 11 Facebook 13 Google+ 4 Pin It Share 0 LinkedIn 4 Email -- Buffer 0 32 Flares ×

Pin Icons to Start Menu for All Users with GPO 01 255x300 Pin Icons to Start Menu for All Users with GPO

Pinning and unpinning icons to the Start Menu or Taskbar can be a pain on Windows 2008 or Windows 7. After doing some research I came up with an how to that I wanted to share with you today.

The first problem I got was that the Pin to Taskbar / Start Menu was missing from the menu.

Pin Icons to Start Menu for All Users with GPO 02 300x225 Pin Icons to Start Menu for All Users with GPO

It seems like it’s not possible to do this when the Start Menu are redirected to a network drive. Simply copy the icons you want to your Desktop.

Pin Icons to Start Menu for All Users with GPO 03 222x300 Pin Icons to Start Menu for All Users with GPO

Pin the icons to the locations you want so the settings get’s saved to registry.

Pin Icons to Start Menu for All Users with GPO 04 218x300 Pin Icons to Start Menu for All Users with GPO

Now head into the %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned folder and copy the icons to a network share you can use in Group Policy Preferences.

Pin Icons to Start Menu for All Users with GPO 05 300x154 Pin Icons to Start Menu for All Users with GPO

Define the folders you want to copy

Pin Icons to Start Menu for All Users with GPO 06 300x120 Pin Icons to Start Menu for All Users with GPO

Pinning icons to the users Start menu contains of 2 components, the icons in the User Pinned folder and in registry. Open registry and export HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage2

Pin Icons to Start Menu for All Users with GPO 07 300x149 Pin Icons to Start Menu for All Users with GPO

I’m using the fantastic tool Reg2XML to convert registry files to XML.

Pin Icons to Start Menu for All Users with GPO 08 300x172 Pin Icons to Start Menu for All Users with GPO

The last step is to import the XML file to Group Policy Preferences.

Pin Icons to Start Menu for All Users with GPO 09 300x155 Pin Icons to Start Menu for All Users with GPO

Thanks Microsoft for making this so easy! There’s also a custom PowerShell module you can use to pin / unpin icons, but this didn’t support command line switches. What I mean with this is that I couldn’t add icons for applications like Notes where you have Notes.exe =H:\Notes\Data\Notes.ini in the path.

Are you doing this in other ways? Please share with the Citrix Community by leaving a comment below.

14 Responses to Pin Icons to Start Menu for All Users with GPO

  1. Dagfinn says:

    I have used this script to remove all default shortcuts and add Internet Explorer + Word and Excel
    You can edit it to add more shotcuts.

    *******************************
    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    ‘ CONSTS
    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    Const HKEY_CLASSES_ROOT = &H80000000
    Const HKEY_CURRENT_USER = &H80000001
    Const HKEY_LOCAL_MACHINE = &H80000002
    Const HKEY_USERS = &H80000003
    Const HKEY_CURRENT_CONFIG = &H80000005

    Const CSIDL_COMMON_PROGRAMS = &H17
    Const CSIDL_PROGRAMS = &H2

    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    ‘ OBJECTS
    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    Set objRegistry = GetObject(“winmgmts:\\.\root\default:StdRegProv”)
    Set objFSO = CreateObject(“Scripting.FileSystemObject”)
    Set objApplication = CreateObject(“Shell.Application”)
    Set objAllUsersPrograms = objApplication.NameSpace(CSIDL_COMMON_PROGRAMS)
    Set objUserPrograms = objApplication.NameSpace(CSIDL_PROGRAMS)

    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    ‘ VARIABLES
    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    Dim arrSubValues, arrDeleteApps, arrPinApps, strAllUsersProgramsPath

    strAllUsersProgramsPath = objAllUsersPrograms.Self.Path & “\”
    strUserProgramsPath = objUserPrograms.Self.Path & “\”
    arrDeleteApps = Array(“displayswitch.lnk”, “remote desktop connection.lnk”, “sticky notes.lnk”, “snipping tool.lnk”, “calculator.lnk”, “paint.lnk”, “xps viewer.lnk”, “windows fax and scan.lnk”, “Magnify.lnk”)

    Call Main

    Sub Main()
    DeleteStartMenuApps HKEY_CURRENT_USER, “”, arrDeleteApps

    DoVerb “Pin to Start Menu”, strUserProgramsPath & “Internet Explorer.lnk”

    ‘Get the version of Office installed, so that we can pin it to the start menu
    If IsProgramInstalled(objRegistry, “Microsoft Office Enterprise 2007″) = TRUE Then
    DoVerb “Pin to Start Menu”, strAllUsersProgramsPath & “Microsoft Office\Microsoft Office Word 2007.lnk”
    DoVerb “Pin to Start Menu”, strAllUsersProgramsPath & “Microsoft Office\Microsoft Office Excel 2007.lnk”
    Else
    DoVerb “Pin to Start Menu”, strAllUsersProgramsPath & “Microsoft Office\Microsoft Word 2010.lnk”
    DoVerb “Pin to Start Menu”, strAllUsersProgramsPath & “Microsoft Office\Microsoft Excel 2010.lnk”
    End If
    End Sub

    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    ‘ FUNCTIONS AND SUBS
    ‘=-=-=-=-=-=-=-=-=-=-=-=-=
    Function DoVerb(strVerb, strPath)
    On Error Resume Next
    strFolder = objFSO.GetParentFolderName(strPath)
    strFile = objFSO.GetFileName(strPath)

    Set objFolder = objApplication.NameSpace(strFolder)
    Set objFolderItem = objFolder.ParseName(strFile)

    For Each ItemVerb In objFolderItem.Verbs
    If StrComp(Replace(ItemVerb.Name, “&”, “”), strVerb, vbTextCompare) = 0 Then
    ItemVerb.DoIt
    Exit Function
    End If
    Next
    On Error Goto 0
    End Function

    Sub DeleteStartMenuApps(hDefKey, sSubKeyUser, arrDeleteApps)
    If Len(sSubKeyUser) > 0 Then
    sSubKeyName = sSubKeyUser & “\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist”
    Else
    sSubKeyName = “Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist”
    End If

    objRegistry.EnumKey hDefKey, sSubKeyName, arrSubKeys

    If IsArray(arrSubKeys) Then
    For i = 0 to UBound(arrSubKeys)
    sTempSubKeyName = sSubKeyName & “\” & arrSubKeys(i) & “\Count”
    objRegistry.EnumValues hDefKey, sTempSubKeyName, arrSubValues

    If IsArray(arrSubValues) Then
    For m = 0 to UBound(arrSubValues)
    For n = 0 to UBound(arrDeleteApps)
    If InStr(UCase(RunROT13(arrSubValues(m))), UCase(arrDeleteApps(n))) > 0 Then
    objRegistry.DeleteValue hDefKey, sTempSubKeyName, arrSubValues(m)
    End If
    Next
    Next
    End If
    Next
    End If
    End Sub

    Function RunROT13(strInput)
    For i = 1 to Len(strInput)
    iChr = Asc(Mid(strInput, i, 1))
    If (iChr >= 65 and iChr = 97 and iChr = 78 and iChr = 110 and iChr <= 122) Then
    strOutput = strOutput & Chr(iChr -13)
    Else
    strOutput = strOutput & Chr(iChr)
    End If
    Next

    RunROT13 = strOutput
    End Function

    Function IsProgramInstalled(objRegistry, strProgramDisplayName)
    intRegistryHive = HKEY_LOCAL_MACHINE
    strRegistryKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

    objRegistry.EnumKey intRegistryHive, strRegistryKey, arrSubkeys

    IsProgramInstalled = FALSE

    For Each strSubkey In arrSubkeys
    strDisplayName = ReadRegistryValue(objRegistry, "STRING", intRegistryHive, strRegistryKey & "\" & strSubkey, "DisplayName")

    If UCase(strDisplayName) = UCase(strProgramDisplayName) Then
    IsProgramInstalled = TRUE
    Exit For
    End If
    Next
    End Function

    Function ReadRegistryValue(objRegistry, strType, intRegistryHive, strSubKeyName, sValueName)
    Select Case UCase(strType)
    Case "DWORD"
    objRegistry.GetDWORDValue intRegistryHive, strSubKeyName, sValueName, strValue
    Case "EXPANDEDSTRING"
    objRegistry.GetExpandedStringValue intRegistryHive, strSubKeyName, sValueName, strValue
    Case "MULTISTRING"
    objRegistry.GetMultiStringValue intRegistryHive, strSubKeyName, sValueName, strValue
    Case "STRING"
    objRegistry.GetStringValue intRegistryHive, strSubKeyName, sValueName, strValue
    End Select

    ReadRegistryValue = strValue
    End Function

  2. Great script Dagfinn, thanks for sharing

  3. Clemens says:

    Hi
    I find redirected Startmenu convenient for smaller Sites (up to 200 Users).
    I share the folder on the network, enable ABE on that one, create a GPO for redirecting the Startmenu (Startmenu has to be classic style) for all users and give permissions to APP Groups, where I add the according Users to. The Icons have to be created from one of the XenApp Servers. Any user without being member in that group does not see the Icon, only members do.
    I don’t like that folder sitting on a DFSR

  4. Gdmac says:

    Thanks for the article which will come in handy for our XenApp 65 project. Is there a similar script for my existing Windows 2003 servers?

  5. Andy says:

    I have seen this done with a simple script called PinItems.vbs

    https://gist.github.com/368910

    Which you can use as a part of your login script for users, and then get it to pin to either the start menu or the task bar.

    Andy

  6. Thomas says:

    Actually it’s very simple, you just have to follow the Windows way. I can see already from the screen shots the issue…

    I will post something about it on my website

    Thomas

  7. Thomas says:

    I posted it
    Pin Icons with a redirected Start Menu
    http://bit.ly/pinapps

    Thomas

    • Don Schaefer says:

      Thomas,

      Your blog was nice, but unfortunately, your method does not work for Citrix published apps, which is the point of this entire thread.

      Regards,

  8. still says:

    Thanks for these useful informations.

    BTW : Just Favorites and FavoritesResolve are mandatory to pinned shortcuts to the Start Menu.

    Source : http://blog.ressoftware.com/index.php/2011/01/20/start-menu-jump-lists-explained/

Leave a reply

Name: Email:
32 Flares Twitter 11 Facebook 13 Google+ 4 Pin It Share 0 LinkedIn 4 Email -- Buffer 0 32 Flares ×