icinga-powershell-framework/lib/core/tools/Test-AdministrativeShell.psm1

12 lines
343 B
PowerShell
Raw Normal View History

function Test-AdministrativeShell()
{
$WindowsPrincipcal = New-Object System.Security.Principal.WindowsPrincipal(
[System.Security.Principal.WindowsIdentity]::GetCurrent()
);
if ($WindowsPrincipcal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) {
return $TRUE;
}
return $FALSE;
}