User Tools

Site Tools


adsetup:group_policy_preferences:createcomputershortcutspreferences

To create a correctly formatted Shortcuts GPP, follow the below guidelines.1). It is also clear that Microsoft has yet to significantly update GPP to support Windows 10. It is just a matter of time before some of these items are depreciated and will not work on modern desktops.

Computer Shortcuts GPP

$XMLItemAttributes = ("clsid","disabled","name","status","image","changed","uid","bypassErrors","desc","removePolicy","PRIMARYEND","action","pidl","targetType","comment","startIn","targetPath","arguments","shortcutPath","shortcutKey","iconPath","iconIndex","window","RUNONCE","SUBEND")


User Shortcuts GPP

$XMLItemAttributes = ("clsid","disabled","name","status","image","changed","uid","bypassErrors","userContext","desc","removePolicy","PRIMARYEND","action","pidl","targetType","comment","startIn","targetPath","arguments","shortcutPath","shortcutKey","iconPath","iconIndex","window","RUNONCE","SUBEND")


$XMLItemAttributes values

clsid - This is the clsid of the GPP file item. GPP clsid Reference

disabled - Enabled or Disabled . Icon color is indicating the action taken when pressed. On an enabled GPP it is red and on a disabled GPP is green.


name - Name of the GPP item.

status - A field that is updated when the value of the GPP is updated. Can be the same text as name or value.

image - This is the image that is shown in the Group Policy GUI. Image Reference

changed - Date the GPP is set. $DateUni = (Get-Date -Format u).TrimEnd('Z').

uid - Generate GUID. $GUID = ([guid]::NewGuid()).ToString().ToUpper().

bypassErrors - Sets the Stop processing items in this extension is an error occurs. Value of 1 is unchecked, value of 0 is checked.

userContext Sets the Run in logged-on user's security context (user policy option). Value of 1 is checked, value of 0 is unchecked. Only used in User File GPP.

desc Set's the Description text. By default includes the $FirmName and $Date. Useful to add additional notes about what the setting actually controls.

removePolicy - Sets the Remove this item when it is no longer applied. Value of 1 is checked, value of 0 is unchecked.

PRIMARYEND - Internal script header to indicate XML subnode.



action - Identifies the action for the GPP.

Action Value
Create C
Replace R
Update U
Delete D

pidl - Value of common item identifier. Used if the shortcut is selected as SHELL. Here are some common ones or review this MSDN article for the identification of additional PIDL's. Some shell ID's are specific to accounts so there use caution in attempting to roll these out. File System Object is likely more reliable and flexible.
Common PIDL's
Shell Object PIDL
Desktop 0000
This PC 00009D30302B0008D8A210693AEA20D04FE0501F0014
Control Panel 0000A0CBFD70881DCE8F4D6C6CE55399E694801F0014
Network 00003CEF96FC6773B0884350BE21F02C1A0D581F0014

targetType - Can be set to a value of: FILESYSTEM, URL, SHELL.
Value GPP Reference Notes
FILESYSTEM File System Object See shortcutPath below for reference.
URL URL Set the target path to a valid URL.
SHELL Shell Object See pidl above for reference.

comment - Updates the comment field and the ToolTip of the shortcut.

startIn - Set the Start in: directory of the shortcut and needs to be a working directory.

targetPath - This is the location of the executable.

arguments - Specify any additional arguments required.

shortcutPath - The path to the location the shortcut.
Selection Value
<Specify full path> Add the desired locations full path to the name field.
Desktop %DesktopDir%\name
Start Menu %StartMenuDir%\name
Programs %ProgramsDir%\name
StartUp %ProgramsDir%\name
Explorer Favorites %FavoritesDir%\name
Explorer Links %FavoritesDir%\Links\name
Send To %SendToDir%\name
Recent %RecentDocumentsDir%\name
Quick Launch Toolbar %AppDataDir%\Microsoft\Internet Explorer\Quick Launch\name
My Network Places %NetPlacesDir%\name
All Users Desktop %CommonDesktopDir%\name
All Users Start Menu %CommonStartMenuDir%\name
All Users Programs %CommonProgramsDir%\name
All Users Startup %CommonStartUpDir%\name
All Users Explorer Favorites %CommonFavoritesDir%\name


shortcutKey - Default is 0 for none. The documentation states that this MUST be a key combination. The best was to ensure the correct value is used is to create a test shortcut and assign the key combination and then view the XML created. Multiple key combinations works as well, i.e. Ctrl-Shift, Alt-Shift…

Sample Values
Key Ctrl Alt Shift
1 561 1073 305
T 596 1108 340
. 702 1214 446

iconPath - The path to the file that holds the shortcut icon, usually the executable.


iconIndex - The index of the icon in the executable, the first icon is number 0.

window - Specifies how the shortcut should launch, a regular, maximized or minimized window. Values are
Window Value
Normal
Maximized MAX
Minimized MIN

RUNONCE - Signifies if the GPP should be set to Apply once and do not reapply. Valid values are YES or NO.

SUBEND - Internal script header to indicate XML subnode ending.



Shortcut GPP Examples

1)
Most information is covered here, but for a complete Shortcut Item reference, visit this article at TechNet.
adsetup/group_policy_preferences/createcomputershortcutspreferences.txt · Last modified: 2017/04/01 03:14 by rob