-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpo-edit
More file actions
29 lines (23 loc) · 738 Bytes
/
gpo-edit
File metadata and controls
29 lines (23 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<#
$xmlText = @”
<? Xml version=”1.0” encoding=”uft-8”>
<Drives clsid=”{letter-number-string}”>
<Drive clsid=”{letter-number-string}”>
<Properties action =”R” thisDrive=”SHOW” allDrives=”NOCHANGE” username= “” etc..>
<Filters>
<FilterGroup bool=”AND” etc….>
</Filters>
</Drive>
</Drives>
”@
#>
$xmlPath = Path\to\gpo\properties\xml
$xmlData = [xml] (get-content -Path $xmlPath)
$oldFilter = @($xmlData.Drives.Drive.Filters.FilterGroup)[0]
$oldFilter.bool = “OR”
$newFilter = $oldFilter.Clone()
$newFilter.bool = “OR”
$newFilter.name = “thisIs\MyName”
$newFilter.sid = “my-s-i-d”
$xmlData.Drives.Drive.Filters.AppendChild($newFilter)
($xmlData).Save($xmlPath)