Public/Get-SpecRunAsLevel.ps1
function Get-SpecRunAsLevel { param ( [string]$RunAsLevel ) # set the task runas level if ([string]::IsNullOrEmpty($RunAsLevel)) { $RunAsLevel = 'NullOrEmpty' } switch ($RunAsLevel) { 'NullOrEmpty' { return 'NT AUTHORITY\SYSTEM' } 'BUILTIN\Users' { return 'BUILTIN\Users' } 'BUILTIN\Administrators' { return 'BUILTIN\Administrators' } default { return 'NT AUTHORITY\System' } } } |