1 2 3 4 5 6 7 8 |
Function Test-AmIAdministrator { [bool]$Result = $false $CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Groups if (($CurrentUser | Where-Object {$_.Value -eq "S-1-5-32-544"}).Count -gt 0) { $Result = $true } Return $Result } |