Skip to content

Commit

Permalink
Merge pull request #24 from PatrickOnGit/FolderRedirectionType
Browse files Browse the repository at this point in the history
Added folder redirection type
  • Loading branch information
PrzemyslawKlys authored Aug 24, 2021
2 parents 5590e3b + e56cf3b commit 82c21ed
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Private/ConvertTo-XMLFolderRedirection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@
[PSCustomObject] $GPO,
[switch] $SingleObject
)
# Redirection types a stored as GUID in GPOs. This hash is used to translate into readable text.
$FolderID = @{
"{1777F761-68AD-4D8A-87BD-30B759FA33DD}" = "Favorites"
"{FDD39AD0-238F-46AF-ADB4-6C85480369C7}" = "Documents"
"{33E28130-4E1E-4676-835A-98395C3BC3BB}" = "Pictures"
"{4BD8D571-6D19-48D3-BE97-422220080E43}" = "Music"
"{18989B1D-99B5-455B-841C-AB7C74E4DDFC}" = "Videos"
"{3EB685DB-65F9-4CF6-A03A-E3EF65729F3D}" = "AppDataRoaming"
"{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" = "Desktop"
"{625B53C3-AB48-4EC1-BA1F-A1EF4146FC19}" = "StartMenu"
"{374DE290-123F-4565-9164-39C4925E467B}" = "Downloads"
"{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}" = "Saved Games"
"{56784854-C6CB-462B-8169-88E350ACB882}" = "Contacts"
"{7D1D3A04-DEBB-4115-95CF-2F29DA2920DA}" = "Searches"
"{BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968}" = "Links"
}
if ($SingleObject) {
$CreateGPO = [ordered]@{
DisplayName = $GPO.DisplayName
Expand All @@ -18,6 +34,8 @@
[Array] $CreateGPO['Settings'] = foreach ($Folder in $GPO.DataSet) {
foreach ($Location in $Folder.Location) {
[PSCustomObject] @{
ID = $Folder.ID
FolderType = $FolderID[$Folder.Id]
DestinationPath = $Location.DestinationPath
SecuritySID = $Location.SecurityGroup.SID.'#text'
SecurityName = $Location.SecurityGroup.Name.'#text'
Expand Down Expand Up @@ -47,6 +65,7 @@
GUID = $GPO.GUID
GpoType = $GPO.GpoType
Id = $Folder.Id
FolderType = $FolderID[$Folder.Id]
DestinationPath = $Location.DestinationPath
SecuritySID = $Location.SecurityGroup.SID.'#text'
SecurityName = $Location.SecurityGroup.Name.'#text'
Expand Down

0 comments on commit 82c21ed

Please sign in to comment.