To create a correctly formatted Folder GPP, follow the below guidelines.

Computer Folder GPP

$XMLItemAttributes = ("clsid","disabled","name","status","image","changed","uid","bypassErrors","desc","removePolicy","PRIMARYEND","action","path","deleteFolder","deleteSubFolders","deleteFiles","deleteReadOnly","deleteIgnoreErrors","readonly","archive","hidden","RUNONCE","SUBEND")


User Folder GPP

$XMLItemAttributes = ("clsid","disabled","name","status","image","changed","uid","bypassErrors","userContext","desc","removePolicy","PRIMARYEND","action","path","deleteFolder","deleteSubFolders","deleteFiles","deleteReadOnly","deleteIgnoreErrors","readonly","archive","hidden","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

path - The Folder to perform an action on.

deleteFolder - Sets the Delete this folder (if emptied) option. Only available for Delete action. Value of 1 is checked, value of 0 is unchecked.

deleteSubFolders - Sets the Recursively delete all subfolders (if emptied) option. Only available for Delete action. Value of 1 is checked, value of 0 is unchecked.

deleteFiles - Sets the Delete all files in folder(s) option. Only available for Delete action. Value of 1 is checked, value of 0 is unchecked.

deleteReadOnly - Sets the All deletion of read-only files/folders option. Only available for Delete action. Value of 1 is checked, value of 0 is unchecked.

deleteIgnoreErrors - Sets the Ignore errors for files/folders that cannot be deleted option. Only available for Delete action. Value of 1 is checked, value of 0 is unchecked.

readonly - Sets the Read-only attribute of the file. Value of 1 is checked, value of 0 is unchecked.

archive - Sets the Archive attribute of the file. Value of 1 is checked, value of 0 is unchecked.

hidden - Sets the Hidden attribute of the file. Value of 1 is checked, value of 0 is unchecked.

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.



Folder GPP Example
See Deployment for instructions on updating GPP.

$XMLItemValues += @($FolderCLSID,"1","AutoRecover","AutoRecover","0",$DateUni,$GUID,"1","1","Created By $FirmName on $Date. Creates the Network AutoRecover Directory for Office.","0","PRIMARYEND","C","%HOMESHARE%\AutoRecover","0","0","0","0","0","0","1","0","Yes","SUBEND")

In this example the Office AutoRecover folder is created in the users home directory. 1)

1)
User accounts should have the home directory filed out in AD so the %HOMESHARE% variable is available