Skip to content

Commit 09f5d3f

Browse files
authored
Update Set-UserRights.ps1
When a right has no value set, it does not appear in the export.inf so when you can't find a right it should be added.
1 parent 1107ea9 commit 09f5d3f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Powershell/General Functions/Set-UserRights.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
6969
Author: Blake Drumm (blakedrumm@microsoft.com)
7070
First Created on: January 5th, 2022
71-
Last Modified on: April 23rd, 2022
71+
Last Modified on: October 12th, 2022
7272
#>
7373
param
7474
(
@@ -223,7 +223,13 @@ PROCESS
223223
$sids = (Select-String $export -Pattern "$right").Line
224224
if ($ActionType -eq 'Adding')
225225
{
226-
$sidList = "$sids,*$sid"
226+
# If right has no value it needs to be added
227+
if($sids -eq $null) {
228+
$sids = "$right = *$sid"
229+
$sidList = $sids
230+
} else {
231+
$sidList = "$sids,*$sid"
232+
}
227233
}
228234
elseif ($ActionType -eq 'Removing')
229235
{

0 commit comments

Comments
 (0)