I have a simple PowerShell script to stop a process:
$p = get-process $args
if ( $p -ne $null )
{
$p | stop-process
$p | select ProcessName, ID, HasExited, C
This script sectio check for the Medium Mandatory level token (non elevated admin) and restarts the script elevated.
if ($Mygroups -match ".*Mandatory Label\\Medium Mandatory Level") {
#non elevated admin: elevating
write-host "Elevate"
start-process powershell -Argumentlist "$PSCommandPath -Yourargument $Youragumentvalue" -verb runas -Wait
exit
}