Skip to content

Commit f9b81b3

Browse files
authored
Merge pull request #3 from dwknight70/Fix-Test-UserAdminMembership
Fixed Test-UserAdminMembership so the result is correct regardless if…
2 parents 9bd78b4 + 0cdc1ad commit f9b81b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Code snippets/Functions library.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-UserAdminMembership {
2121
This function checks whether the current user account is a member of the local Administrators group. If the answer is positive, depending on the User Account Control configuration on this machine, this script may either be running with administrative privileges or may request it.
2222
#>
2323
$MyId = [System.Security.Principal.WindowsIdentity]::GetCurrent()
24-
return $MyId.Name -in $(Get-LocalGroupMember -Name Administrators).Name
24+
return $MyId.Claims.Value.Contains('S-1-5-32-544')
2525
}
2626

2727
function Unregister-ScheduledTaskEx {

0 commit comments

Comments
 (0)