Skip to content

Commit

Permalink
Multiple bug fixes, address #78
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwalker committed May 22, 2018
1 parent adc2b5c commit b0a646b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function Get-UserRightPolicy

$userRightConstant = Get-UserRightConstant -Policy $Name

$userRights = Get-SecurityPolicy -Area 'USER_RIGHTS'
$userRights = Get-SecurityPolicy -Area 'USER_RIGHTS' -Verbose:$VerbosePreference

[PSObject]@{
Constant = $userRightConstant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function Get-SecurityPolicy
foreach ($key in $privilegeRights.keys )
{
$policyName = Get-UserRightConstant -Policy $key -Inverse
$identity = ConvertTo-LocalFriendlyName -Identity $($privilegeRights[$key] -split ",").Trim() -Policy $policyName
$identity = ConvertTo-LocalFriendlyName -Identity $($privilegeRights[$key] -split ",").Trim() -Policy $policyName -Verbose:$VerbosePreference
$returnValue.Add( $key,$identity )
}

Expand Down Expand Up @@ -277,12 +277,12 @@ function ConvertTo-LocalFriendlyName
if ($null -ne $id -and $id -match '^(S-[0-9-]{3,})')
{
# if id is a SID convert to a NTAccount
$friendlyNames += ConvertTo-NTAccount -SID $id -Policy $Policy -Scope $Scope
$friendlyNames += ConvertTo-NTAccount -SID $id -Policy $Policy -Scope $Scope -Verbose:$VerbosePreference
}
else
{
# if id is an friendly name convert it to a sid and then to an NTAccount
$friendlyNames += ( ConvertTo-Sid -Identity $id | ConvertTo-NTAccount -Policy $Policy -Scope $Scope )
$friendlyNames += ( ConvertTo-Sid -Identity $id -Verbose:$VerbosePreference | ConvertTo-NTAccount -Policy $Policy -Scope $Scope )
}
}

Expand Down Expand Up @@ -359,7 +359,7 @@ function ConvertTo-NTAccount
if ($Scope -eq 'Get')
{
Write-Verbose -Message ($script:localizedData.ErrorSidTranslation -f $sidId, $Policy)
$result += $sidId.Value #($script:localizedData.ErrorSidTranslation)
$result += $sidId.Value
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ to ensure the resource configuration instance is unique.
* Updated documentation.
* Add example of applying Kerberos policies
* Added hyper links to readme
* Refactored the SID translation process to not throw a terminating error when called from Test-TargetResource
* Updated verbose message during the SID transliation process to identiy the policy where an orphaned SID exists

### 2.2.0.0
* Fixed bug in UserRightAssignment where Get-DscConfiguration would fail if it returns $Identity as single string

Expand Down

0 comments on commit b0a646b

Please sign in to comment.